Constructor
new module:ct-core /log /Abstract Logger(level, delegateopt)
Constructs an AbstractLogger. Will usually be called in the super constructor of subclasses.
Extends:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
level |
Number | the level at which to log messages. Should be one of the static levels defined on this class. Will default to the most fine level if not provided. |
|
delegate |
function |
<optional> |
function or other |
Extends
Members
(inner) DEBUG
Logs at a level suitable for developers. May contain things like network level messages.
(inner) ERROR
Should only be used to log unrecoverable errors. The application will probably not continue to function correctly after one of these errors. Messages at this level should be readable by non-developers.
(inner) INFO
Logs messages that could be useful information. Messages at this level should be somewhat readable by non-developers.
(inner) TRACE
Logs at a very fine level, suitable for method entry / exits, etc.
(inner) WARN
Logs messages that may indicate problems, but where the system is able to continue. Messages at this level should be readable by non-developers.
Methods
debug()
Log a 'debug' message.
A variable argument method. See module:ct-core/log/Log.interpolate
for more information.
- Inherited From:
error()
Log an 'error' message.
A variable argument method. See module:ct-core/log/Log.interpolate
for more information.
Avoid using this method, as it is intended only to be used at the top level.
- Inherited From:
info()
Log an 'info' message.
A variable argument method. See module:ct-core/log/Log.interpolate
for more information.
- Inherited From:
trace()
Log a 'trace' message.
A variable argument method. See module:ct-core/log/Log.interpolate
for more information.
- Inherited From:
warn()
Log a 'warn' message.
A variable argument method. See module:ct-core/log/Log.interpolate
for more information.
- Inherited From:
(inner) log(level Name, log Data)
The abstract method that should be overridden by subclasses or by providing a delegate to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
levelName |
String | the name of the method that was called. |
logData |
Array | the log information. |
(inner) log Data ToString(log Data) → {String}
Turns an array of logging data into a string according to the caplin logging scheme.
Parameters:
Name | Type | Description |
---|---|---|
logData |
Array | an array containing all the data that should be logged. |
- See:
-
- module:ct-core/log/Log.interpolate for more information.
Returns:
A string representation of the logData provided.
- Type
- String
(inner) set Level(level)
Changes the level at which this logger logs.
Parameters:
Name | Type | Description |
---|---|---|
level |
Number | a log level, chosen from those available on this class. |