LoggingSession implements InternalSessionContext { public synchronized void startSession() { state = state.changeTo(STARTED); loggingSessionNotifier.startSession(); if (!standardOutputAlwaysOn) { configuration.disableLoggingToStandardOutputIfLoggingToFile(); } if (logBanner) { logger.info(new Banner(configuration.getConfigurationInfo()).getString()); } if (logConfiguration) { String configInfo = configuration.getLogConfigSupplier().getLogConfig().toLoggerString(); logger.info(STARTUP_CONFIGURATION + System.lineSeparator() + configInfo); } } LoggingSession(final Configuration configuration,
      final LoggingSessionNotifier loggingSessionNotifier); static LoggingSession create(); synchronized void createSession(final LogConfigSupplier logConfigSupplier); synchronized void createSession(final LogConfigSupplier logConfigSupplier,
      final boolean logBanner, final boolean logConfiguration); synchronized void createSession(final LogConfigSupplier logConfigSupplier,
      final boolean logBanner, final boolean logConfiguration,
      final boolean standardOutputAlwaysOn); synchronized void startSession(); synchronized void stopSession(); synchronized void shutdown(); Optional<LogFile> getLogFile(); @Override State getState(); @Override LogConfigSupplier getLogConfigSupplier();  }
@Test public void startSessionThrowsIfSessionNotCreated() { assertThatThrownBy(() -> loggingSession.startSession()) .isInstanceOf(IllegalStateException.class); }