Class: Logger

.logManager. Logger

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 debug level for the current module.

Parameters:
Name Type Description
message string
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 error level for the current module.

Parameters:
Name Type Description
message string
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 info level for the current module.

Parameters:
Name Type Description
message string
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 trace level for the current module.

Parameters:
Name Type Argument Description
message string

message to log

data object <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 warn level for the current module.

Parameters:
Name Type Description
message string
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
level string
Example
     var logger = ATT.logManager.getLogger('moduleName');
     logger.setLogLevel(level);