The logManager object allows users to utilize the functionality provided by the SDK with operations like adding a logger for a module, getting a logger by passing a module name, updating a log level on a module and setting the log level on all modules.
Classes
Methods
-
<static> createCustomLogger(module)
Creates a custom logger for a given module.
-
Use this function to create a custom logger by passing a module name.
Parameters:
Name Type Description module
string Name of module
Example
var logger = ATT.logManager.createCustomLogger('moduleName');
-
<static> deleteCustomLogger(module)
Deletes a custom logger for a given module.
-
Use this function to delete a custom logger by passing a module name.
Parameters:
Name Type Description module
string Name of module
Example
var logger = ATT.logManager.deleteCustomLogger('moduleName');
-
<static> getCurrentModuleLogLevels() → {object}
Gets current modules and their log levels.
-
Use this function to get the current modules with their defined log levels.
Returns:
{moduleName1: level, moduleName2: level, ...}
- Type
- object
Example
var currentModules = ATT.logManager.getCurrentModuleLogLevels();
-
<static> getGlobalLogLevel() → {string}
Gets the current log level for all modules.
-
Use this function to get the current log level for all modules.
The following strings describe the log level for all modules:
'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 logLevel = ATT.logManager.getGlobalLogLevel();
-
<static> getLogger(module) → {Logger}
Gets the logger for a given module.
-
Use this function to get the logger object by passing the module name.
Parameters:
Name Type Description module
string Name of module
Returns:
A logger object.
- Type
- Logger
Example
var logger = ATT.logManager.getLogger('moduleName');
-
<static> getLoggers() → {array}
Gets list of log manager modules.
-
Use this function to get the log manager's list of modules.
Returns:
[moduleName_1, moduleName_2, moduleName_3, ...]
- Type
- array
Example
var loggersList = ATT.logManager.getLoggers();
-
<static> getLogLevels() → {array}
Gets all defined log levels for log manager.
-
Use this function to get all defined log levels for log manager.
The following strings describe the log levels:
'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', 'trace']
- Type
- array
Example
var logLevels = ATT.logManager.getLogLevels();
-
<static> getModuleDefaults() → {object}
Gets the modules that have default log levels.
-
Use this function to get the modules with defined default log levels.
Returns:
{moduleName: level}
- Type
- object
Example
var defaultModulesConfig = ATT.logManager.getModuleDefaults();
-
<static> resetLogLevels()
Resets log levels for all modules to their defaults.
-
Use this function to reset log levels for all modules to their defaults.
Example
ATT.logManager.resetLogLevels();
-
<static> setGlobalLogLevel(level)
Sets the passed log level for all the modules.
-
Use this function to set a log level for all the modules.
Pass the following strings to set the level for all the modules:
'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 level
string Example
ATT.logManager.setGlobalLogLevel('info');