- Fixed potentially breaking "export from" syntax in index.js
- Upgraded dependencies
- [BREAKING CHANGE] Changed method signature of
log()
in Logger tolog(level: string, message: string, context: object)
- [BREAKING CHANGE] Removed methods
clone()
,on()
andoff()
in Logger - [BREAKING CHANGE] Removed options
console
,displayContext
anddisplayName
from Logger constructor - [BREAKING CHANGE] Moved log level constants to levels.js
- [BREAKING CHANGE] Logger must be imported using a named import (
example:
import { Logger } from '@jalik/logger'
) - Added
FATAL
constant log level - Added method
fatal(string|Error, object)
in Logger - Added option
level: string
in Logger constructor (default:info
), it can be one ofdebug
,info
,warn
,error
orfatal
- Added option
outputs: Array<function>
in Logger constructor (default:[consoleOutput()]
) - Added option
defaultContext: null|object
in Logger constructor (default:null
) - Added option
filter: null|function
in Logger constructor (default:null
) - Upgraded dependencies
- Upgraded dependencies
- Upgraded dependencies
- Added
esnext
andsideEffects
in package.json - Renamed logger.js to Logger.js
- Upgraded dependencies
- Upgraded dependencies
- Upgraded dependencies
- Upgraded dependencies
- Upgraded dependencies
- Upgraded dependencies
- Upgraded dependencies
- Upgraded dependencies
- Lib available in ES6+ syntax (see
src
folder) to enable auto-completion in IDEs - Fixes code in README
- Fixes compatibility error
'log' called on an object that does not implement interface Console
- Upgraded dependencies
- Upgraded dependencies
- Upgraded devDependencies
- Changes package's repository URL
- Adds
:
after the logger name (ex:ClassLogger: test
) - Adds method
Logger.clone(name: String)
- Removes useless
return
instruction in the following methods:Logger.debug()
Logger.error()
Logger.info()
Logger.warn()
- Fixes example of
Logger.on(event: String, listener: Function)
in README
- BREAKING: Method
Logger.on(event: String, listener: Function)
has changed to improve ease of use. Before you had to passdebug
,error
,info
orwarning
as the first string argument, now use thelog
event instead. Also in the callback, thetype
of log is inserted as the second argument aftermessage
, thuscontext
is now the third argument.- BEFORE:
Logger.on('error', (message, context) => {})
- NOW:
Logger.on('log', (message, type, context) => {})
- BEFORE:
- Fixes code examples in README
- Upgraded dependencies
- Adds constructor option
displayName: Boolean
- Adds constructor option
name: String
- Adds method
Logger.getName()
- Exports
Logger
using ES6 default export
- Adds options to activate or deactivate console logging for a type of message
- Adds option
Logger.options.console.debug = true
- Adds option
Logger.options.console.error = true
- Adds option
Logger.options.console.info = true
- Adds option
Logger.options.console.other = true
- Adds option
Logger.options.console.warning = true
- Adds option
Logger.options.displayContext = false
- First public release