Uranium
Application Framework
UM.Logger.Logger Class Reference

Static class used for logging purposes. More...

Public Member Functions

def __init__ (self)
 
def addLogger (cls, "Logger" logger)
 Add a logger to the list. More...
 
List["Logger"] getLoggers (cls)
 Get all loggers. More...
 
def log (cls, str log_type, str message, *args, **kwargs)
 Send a message of certain type to all loggers to be handled. More...
 
def logException (cls, str log_type, str message, *args)
 Logs that an exception occurs. More...
 

Detailed Description

Static class used for logging purposes.

This class is only meant to be used as a static class.

Member Function Documentation

◆ addLogger()

def UM.Logger.Logger.addLogger (   cls,
"Logger"  logger 
)

Add a logger to the list.

Parameters
loggerLogger

◆ getLoggers()

List["Logger"] UM.Logger.Logger.getLoggers (   cls)

Get all loggers.

Returns
list List of Loggers

◆ log()

def UM.Logger.Logger.log (   cls,
str  log_type,
str  message,
args,
**  kwargs 
)

Send a message of certain type to all loggers to be handled.

This method supports placeholders in either str.format() style or % style. For more details see the respective Python documentation pages.

Note that only str.format() supports keyword argument placeholders. Additionally, if str.format() makes any changes, % formatting will not be applied.

Parameters
log_typestring Values must be; 'e' (error) , 'i'(info), 'd'(debug) or 'w'(warning).
messagestring containing message to be logged
*argslist List of placeholder replacements that will be passed to str.format() or %.
**kwargsdict List of placeholder replacements that will be passed to str.format().

◆ logException()

def UM.Logger.Logger.logException (   cls,
str  log_type,
str  message,
args 
)

Logs that an exception occurs.

It'll include the traceback of the exception in the log message. The traceback is obtained from the current execution state.

Parameters
log_typeThe importance level of the log (warning, info, etc.).
messageThe message to go along with the exception.

The documentation for this class was generated from the following file: