flatlog module. it exports constructor of FlatLog
- Source:
Example
const flatlog = requier('./lib/flatlog')
const LogLevel = flatlog.LogLevel
var config = {verbose: tue, 'gwisp'}
var logger = new flatlog(config)
// quick use
logger.info('start new day')
logger.notice('work done', 'kevin')
logger.error('go to workspace')
// other ways to use
logger.log(LogLevel.INFO, 'start new day')
logger.log(LogLevel.NOTICE, 'work done')
logger.log(LogLevel.ERROR, 'go to workspace')
Classes
Members
(static, constant) LogLevel :number
Log level
Type:
- number
Properties:
Name | Type | Description |
---|---|---|
EMERGENCY |
number | system is unusable |
ALERT |
number | action must be taken immediately |
CRITICAL |
number | the system is in critical condition |
ERROR |
number | error condition |
WARNING |
number | warning condition |
NOTICE |
number | a normal but significant condition |
INFO |
number | a purely informational message |
DEBUG |
number | messages to debug an application |
- Source:
Type Definitions
Config
Configuration of logger
Type:
- object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
config.verbose |
boolean |
<optional> |
true | Decide log message or not |
config.caller |
string |
<optional> |
anonymous | Default caller will be write |
- Source:
Example
var config = {
verbose: true,
'gwisp'
}