new Logger()
Logger class
Methods
-
<static> getLogLevel() → {string}
Gets the current log level for the current module.
-
Use this function to get the current log level for the current module.
The following strings describe the log level for the current module:
'error' to log Error
'warn' for Error and Warning
'info' for all of the above and Info
'debug' for all of the above and Debug
'trace' for all of the above and Trace
Returns:
'error','warn','info','debug', or'trace'- Type
- string
Example
var logger = ATT.logManager.getLogger('moduleName'), logLevel = logger.getLogLevel(); -
<static> isCustomType() → {boolean}
Returns true if the logger is a custom logger
-
Use this function to check if the logger is a custom logger
Returns:
- Type
- boolean
-
<static> logDebug(message)
Logs the passed message as a debug for the current module.
-
Use this function to log a message as
debuglevel for the current module.Parameters:
Name Type Description messagestring Example
var logger = ATT.logManager.getLogger('moduleName'); logger.logDebug(message); -
<static> logError(message)
Logs the passed message as an error for the current module.
-
Use this function to log a message as
errorlevel for the current module.Parameters:
Name Type Description messagestring Example
var logger = ATT.logManager.getLogger('moduleName'); logger.logError(message); -
<static> logInfo(message)
Logs the passed message as an info for the current module.
-
Use this function to log a message as
infolevel for the current module.Parameters:
Name Type Description messagestring Example
var logger = ATT.logManager.getLogger('moduleName'); logger.logInfo(message); -
<static> logTrace(message, data)
Logs the passed message as a trace for the current module.
-
Use this function to log a message as
tracelevel for the current module.Parameters:
Name Type Argument Description messagestring message to log
dataobject <optional>
additional data to log
Example
var logger = ATT.logManager.getLogger('moduleName'); logger.logTrace(message); -
<static> logWarning(message)
Logs the passed message as a warning for the current module.
-
Use this function to log a message as
warnlevel for the current module.Parameters:
Name Type Description messagestring Example
var logger = ATT.logManager.getLogger('moduleName'); logger.logWarning(message); -
<static> setLogLevel(level)
Sets the passed log level for the current module.
-
Use this function to set a log level for the current module.
Pass the following strings to set the level:
'error' to log Error
'warn' for Error and Warning
'info' for all of the above and Info
'debug' for all of the above and Debug
'trace' for all of the above and Trace
Parameters:
Name Type Description levelstring Example
var logger = ATT.logManager.getLogger('moduleName'); logger.setLogLevel(level);