1.1.12 • Published 6 years ago
bellman v1.1.12
Bellman
Yet another console logger. A pretty and powerful one, though.
yarn add bellmanMethods
- reg- registers the file from which logging methods will be called to adjust the width of the- :callerrow
Default config
const Logger = require('bellman')
new Logger()
  .reg()
  .info('info message')
  .debug('debug message')
  .warn('warning message')
  .error('error: %s', new Error())
Custom config
const Logger = require('bellman')
const userConfig = {
  timeTmp: 'HH:mm',
  lineTmp: ':level :time :caller :message',
  colorize: true,
  callerColor: 'yellow.bold',
  levelMap: {
    debug: 'blue',
    info: 'green',
    panic: 'red'
  },
  levelMin: 'debug',
  isFullStack: true
}
new Logger(userConfig)
  .reg()
  .info('info line')
  .debug('debug line')
  .panic('panic line: %s', new Error())
Config
- lineTmp- sets the logging line format. Supported placeholders:- :time- a timestamp in the format defined by the- timeTmpconfig option
- :level- a name of the logging method that has been called
- :caller- a name of the file and a number of the line from which the logging method has been called
- :message- a formatted message combined from the arguments passed to the logging method (util.format is used to fromat messages)
 
- timeTmp- sets the timestamp format (moment is used to format timestamps)
- colorize- overrides whether the coloring should be used or not (chalk is used for colorization)
- callerColor- sets the- :callerpart color.
- levelMap- sets the names, priorities, and colors of the logging methods
- levelMin- sets the logging level
- isFullStack- sets whether the error stack formatter should be used or not- if unset, all the lines that refer files out of the project's directory and all the files within node_modulesdirectories will be removed
- if set, no modifications will be applied to the error-stacks
- isFullStackmay be overridden with- STACK=fulland- FULLSTACK=trueenvironment variables
 
- if unset, all the lines that refer files out of the project's directory and all the files within 
Events
- log- emits metadata of a logged line:- time- a formateed timestamp
- level- a name of the logged message that has been called
- caller- a name of the file and a number of the line from which the logging method has been called
- message- a formatted message
- args- arguments passed the logged message
 
1.1.12
6 years ago
1.1.11
6 years ago
1.1.10
6 years ago
1.1.9
6 years ago
1.1.8
10 years ago
1.1.7
10 years ago
1.1.6
10 years ago
1.1.5
10 years ago
1.1.4
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.11
10 years ago
1.0.9
10 years ago
1.0.8
10 years ago
1.0.6
10 years ago
1.0.5
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago