maxon.LoggerInterface¶
Description¶
maxon.Loggers
registry.Methods Signature¶
|
Adds a logger type to the logger. |
|
Add a new logger to the system.
|
|
Enable or disable the logger.
|
|
Returns the name of the logger. |
Returns if the logger is enabled. |
|
|
Sets the name of the logger. |
|
Sends a string to all added logger types. |
Methods Definition¶
-
LoggerInterface.
AddLoggerType
(ta, loggerTypeCls, cb=None)¶ Adds a logger type to the logger.
- Parameters
ta (
maxon.TARGETAUDIENCE
) –Set the audience.
The logger type will get the string if the target audience matches whenLoggerInterface.Write()
is used.loggerTypeCls (
maxon.LoggerTypeRef
) – The logger type reference to add.cb (function) – Optional callback that is executed to initialize a logger type after added to the logger. E.g. the file logger needs to be initialized with a destination path.
-
static
LoggerInterface.
AddNewLogger
(id, logger, moduleInfo=None)¶ - Add a new logger to the system.Does the same as
Loggers.Insert()
, but also triggers the observers.- Parameters
id (
maxon.Url
) – The maxon Id corresponding to the logger.logger (
maxon.LoggerRef
) – The logger reference to add.moduleInfo (
maxon.ModuleInfo
) – The module which initiates the call. When the module is freed, the logger will be freed too.
-
LoggerInterface.
Enable
(enable)¶ - Enable or disable the logger.If disabled, the logger still consumes strings but discards them.
- Parameters
enable (bool) – True or False to enable or disable the logger.
-
LoggerInterface.
GetName
()¶ Returns the name of the logger.
- Returns
The name.
- Return type
str
-
LoggerInterface.
IsEnabled
()¶ Returns if the logger is enabled.
- Returns
True or False.
- Return type
bool
-
LoggerInterface.
SetName
(name)¶ Sets the name of the logger.
- Parameters
name (str) – The name.
-
LoggerInterface.
Write
(ta=14, str='test', loc=None, level=1)¶ Sends a string to all added logger types.
- Parameters
ta (
maxon.TARGETAUDIENCE
) – All logger types which match the target audience will receive the string.str (str) – Text to print.
loc (
maxon.SourceLocation
) – Source location where the string was printed from.level (
maxon.WRITEMETA
) – Meta information for the current write operation.