Module hw06

Class LoggerTestApp

java.lang.Object
provided.logger.demo.controller.LoggerTestApp

public class LoggerTestApp extends Object
The controller for the demo app
Author:
swong
  • Field Details

    • sharedSystemLogger

      private ILogger sharedSystemLogger
      The global singleton shared logger, obtained from ILoggerControl. Note that this logger defaults to a LogLevel.INFO minimum level. Rather than have the model and view modules directly access this logger, the controller is the sole manager of it and hands it to the various modules of the system. This is a much more extensible method than having the modules directly accessing the shared logger because the constructor can change how the logger is handled without disturbing the modules.
    • nonSharedLogger

      private ILogger nonSharedLogger
      A logger that is not the globally shared logger that the controller will chain after the global logger. This logger is being set to a minimum log level of LogLevel.DEBUG so it will naturally show more log entries than sharedSystemLogger. Note the use of explicit positional arguments in the format string (e.g. "%2$") that enable total control of exactly which values are used and where they are placed in the output string: "[Non-Shared Logger] LogLevel = "+log_level+": "+ log_msg+" @ "+ code_loc
    • view

      private MainFrame view
      The view
    • model

      private MainModel model
      The model
    • pnlLog

      private LoggerPanel pnlLog
      The logger panel that will be embedded in the view
  • Constructor Details

    • LoggerTestApp

      public LoggerTestApp()
      Construct the application
  • Method Details

    • start

      private void start()
      Start the application. This includes chaining another logger (nonSharedLogger) to the end of the system logger.
    • main

      public static void main(String[] args)
      Run the application
      Parameters:
      args - Command line arguments