Skip to content
Snippets Groups Projects
Commit f780b828 authored by admin-sigmundd's avatar admin-sigmundd
Browse files

Added tags FATAL and NOTICE

parent ecb7053e
No related branches found
No related tags found
1 merge request!1Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
......@@ -17,8 +17,10 @@ Note: The options Part may be omitted, as all parts are optional, but using the
### Methods
* `log.info('This is an Information')`
* `log.notice('This is a Notice')`
* `log.warn('This is a Warning')`
* `log.error('This is an Error')`
* `log.fatal('This is a Fatal Message')`
* `log.debug('This is a Debug Message')`
### Options
......
......@@ -19,6 +19,12 @@ function Log (options) {
this.info = function (message) {
this.log('INFO', message)
}
this.notice = function (message) {
this.log('NOTICE', message)
}
this.fatal = function (message) {
this.log('FATAL', message)
}
this.warn = function (message) {
this.log('WARN', message)
}
......@@ -34,12 +40,18 @@ function Log (options) {
case 'INFO':
console.log(msg)
break
case 'NOTICE':
console.log(msg)
break
case 'WARN':
console.warn(msg)
break
case 'ERROR':
console.error(msg)
break
case 'FATAL':
console.error(msg)
break
case 'DEBUG':
console.log(msg)
break
......@@ -54,12 +66,18 @@ function Log (options) {
case 'INFO':
this.graylogger.info(message)
break
case 'NOTICE':
this.graylogger.notice(message)
break
case 'WARN':
this.graylogger.warning(message)
break
case 'ERROR':
this.graylogger.error(message)
break
case 'FATAL':
this.graylogger.critical(message)
break
case 'DEBUG':
this.graylogger.debug(message)
break
......
......@@ -6,6 +6,8 @@ let log = new Log({
})
log.info('This is an Information')
log.notice('This is a Notice')
log.warn('This is a Warning')
log.error('This is an Error')
log.fatal('This is a Fatal Message')
log.debug('This is a Debug Message')
\ No newline at end of file
......@@ -6,6 +6,8 @@ let log = new Log({
})
log.info('This is an Information')
log.notice('This is a Notice')
log.warn('This is a Warning')
log.error('This is an Error')
log.fatal('This is a Fatal Message')
log.debug('This is a Debug Message')
\ No newline at end of file
......@@ -3,6 +3,8 @@ const Log = require('../index.js')
let log = new Log()
log.info('This is an Information')
log.notice('This is a Notice')
log.warn('This is a Warning')
log.error('This is an Error')
log.debug('This is a Debug Message')
log.fatal('This is a Fatal Message')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment