Logger - janklab.mlxshake.internal.logger
janklab.mlxshake.internal.logger.Logger
Helptext
LOGGER Main entry point through which logging happens
The Logger class provides method calls for performing logging, and the ability to look up loggers by name. This is the main entry point through which all janklab.mlxshake.logger logging happens.
Usually you don’t need to interact with this class directly, but can just call one of the error(), warn(), info(), debug(), or trace() functions in the logger namespace. Those will log messages using the calling class’s name as the name of the logger. Also, don’t call the constructor for this class. Use the static getLogger() method instead.
Use this class directly if you want to customize the names of the loggers to which logging is directed.
Each of the logging methods - error(), warn(), info(), debug(), and trace() - takes a sprintf()-style signature, with a format string as the first argument, and substitution values as the remaining arguments. janklab.mlxshake.internal.logger.info(format, varargin) You can also insert an MException object at the beginning of the argument list to have its message and stack trace included in the log message. janklab.mlxshake.internal.logger.warn(exception, format, varargin)
See also: janklab.mlxshake.internal.logger.error janklab.mlxshake.internal.logger.warn janklab.mlxshake.internal.logger.info janklab.mlxshake.internal.logger.debug janklab.mlxshake.internal.logger.trace
Examples:
log = mlxshake.logger.Logger.getLogger(‘foo.bar.FooBar’); log.info(‘Hello, world! Running on Matlab %s’, version);
try some_operation_that_could_go_wrong(); catch err log.warn(err, ‘Caught exception during processing’) end
Class Contents
Properties
Property | Description |
---|---|
jLogger | |
name | |
enabledLevels |
Methods
Method | Description |
---|---|
getLogger | |
listEnabledLevels | List the levels that are enabled for this logger. |
isTraceEnabled | True if TRACE level logging is enabled for this logger. |
isDebugEnabled | True if DEBUG level logging is enabled for this logger. |
isInfoEnabled | True if INFO level logging is enabled for this logger. |
isWarnEnabled | True if WARN level logging is enabled for this logger. |
isErrorEnabled | True if ERROR level logging is enabled for this logger. |
tracej | Log a message at the TRACE level, using SLFJ formatting. |
debugj | Log a message at the DEBUG level, using SLFJ formatting. |
infoj | Log a message at the INFO level, using SLFJ formatting. |
warnj | Log a message at the WARN level, using SLFJ formatting. |
errorj | Log a message at the ERROR level, using SLFJ formatting. |
trace | Log a message at the TRACE level. |
debug | Log a message at the DEBUG level. |
info | Log a message at the INFO level. |
warn | Log a message at the WARN level. |
error | Log a message at the ERROR level. |
dispstrs | DISPSTRS Custom object display strings. |
dispstr | DISPSTR Custom object display string. |
disp | DISP Custom object display. |
Logger | Constructor. |
Properties
jLogger
Helptext:
No helptext available.
name
Attributes: Dependent, NonCopyable
Helptext:
No helptext available.
enabledLevels
Attributes: Dependent, NonCopyable
Helptext:
No helptext available.
Methods
getLogger
Attributes: Static
Signature:
out = Logger.getLogger(identifier)
Helptext:
Gets the named Logger
listEnabledLevels
Signature:
out = listEnabledLevels(this)
Helptext:
List the levels that are enabled for this logger.
isTraceEnabled
Signature:
out = isTraceEnabled(this)
Helptext:
True if TRACE level logging is enabled for this logger.
isDebugEnabled
Signature:
out = isDebugEnabled(this)
Helptext:
True if DEBUG level logging is enabled for this logger.
isInfoEnabled
Signature:
out = isInfoEnabled(this)
Helptext:
True if INFO level logging is enabled for this logger.
isWarnEnabled
Signature:
out = isWarnEnabled(this)
Helptext:
True if WARN level logging is enabled for this logger.
isErrorEnabled
Signature:
out = isErrorEnabled(this)
Helptext:
True if ERROR level logging is enabled for this logger.
tracej
Signature:
tracej(this, msg, varargin)
Helptext:
Log a message at the TRACE level, using SLFJ formatting.
debugj
Signature:
debugj(this, msg, varargin)
Helptext:
Log a message at the DEBUG level, using SLFJ formatting.
infoj
Signature:
infoj(this, msg, varargin)
Helptext:
Log a message at the INFO level, using SLFJ formatting.
warnj
Signature:
warnj(this, msg, varargin)
Helptext:
Log a message at the WARN level, using SLFJ formatting.
errorj
Signature:
errorj(this, msg, varargin)
Helptext:
Log a message at the ERROR level, using SLFJ formatting.
trace
Signature:
trace(this, msg, varargin)
Helptext:
Log a message at the TRACE level.
debug
Signature:
debug(this, msg, varargin)
Helptext:
Log a message at the DEBUG level.
info
Signature:
info(this, msg, varargin)
Helptext:
Log a message at the INFO level.
warn
Signature:
warn(this, msg, varargin)
Helptext:
Log a message at the WARN level.
error
Signature:
error(this, msg, varargin)
Helptext:
Log a message at the ERROR level.
dispstrs
Signature:
out = dispstrs(this)
Helptext:
DISPSTRS Custom object display strings.
dispstr
Signature:
out = dispstr(this)
Helptext:
DISPSTR Custom object display string.
disp
Signature:
disp(this)
Helptext:
DISP Custom object display.
Logger
Signature:
this = Logger(jLogger)
Helptext:
LOGGER Build a new logger object around an SLF4J Logger object.
Generally, you shouldn’t call this. Use logger.Logger.getLogger() instead.