7from .bridge_loggerinterface
import ILogger
8from .bridge_filelogger
import FileLogger
9from .bridge_consolelogger
import ConsoleLogger
10from .bridge_nulllogger
import NullLogger
40 def __init__(self, loggerType : LoggerTypes, *arguments):
43 case Logger.LoggerTypes.ToNull:
44 self.
_logger = NullLogger.CreateLogger()
46 case Logger.LoggerTypes.ToConsole:
47 self.
_logger = ConsoleLogger.CreateLogger()
49 case Logger.LoggerTypes.ToFile:
51 self.
_logger = FileLogger.CreateLogger(arguments[0])
53 msg =
"A filename must be specified for the {0} logger type.".format(loggerType)
57 msg =
"The logger type '{0}' is not recognized. Cannot construct a Logger.".format(loggerType)
@ Close
Window is asked to close itself, generally sent by the window itself in response to a button up in a ...
A value passed to LoggerClassFactory.CreateLogger() to specify the type of logger to create.
Represents the bridge logger object to be used in the program.
def LogError(self, str message)
Log error messages to the configured output.
def __enter__(self)
Entry function used in the with statement to initialize an instance of the reader/writer.
def LogTrace(self, str message)
Log trace messages to the configured output.
_logger
Instance of the desired logger type.
def __init__(self, LoggerTypes loggerType, *arguments)
Constructor that takes a LoggerTypes value and optional arguments to create a new Logger class.
def LogInfo(self, str message)
Log informational messages to the configured output.
def __exit__(self, *args)
Exit function automatically called when used in the with statement.
Represents an implementation of a logger object as called from the Logger class.