diff --git a/README.md b/README.md index 811d0bbb0f032e089bbd361e32bf672e9cec763f..b196ff7610d4c395033f1f9d0d48b6aa2e567bd9 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/index.js b/index.js index 46fc6fa2041f47a90db5dac73089f3c90ac0a040..096a6a0ef5824854f0c2c498140e955b5e8f79c5 100644 --- a/index.js +++ b/index.js @@ -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 diff --git a/samples/all-options.js b/samples/all-options.js index 86411c564ca1feb09165d951fc25d9671c4c44d1..aec3a0e5e0f48e23b44bab5f7bae7b153529b26a 100644 --- a/samples/all-options.js +++ b/samples/all-options.js @@ -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 diff --git a/samples/log-to-file.js b/samples/log-to-file.js index 8f359816e57af37a9bf2afa3b7a858ed800c936a..e5abb11362e0a2aaea1cc87af32dbe4af5c39b48 100644 --- a/samples/log-to-file.js +++ b/samples/log-to-file.js @@ -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 diff --git a/samples/no-options.js b/samples/no-options.js index fe28ba68f876b75f8b17ca26b825ca260e5d08f4..d53c2b361c20cf436b3629c905c237c17d509c0c 100644 --- a/samples/no-options.js +++ b/samples/no-options.js @@ -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') \ No newline at end of file +log.debug('This is a Debug Message') +log.fatal('This is a Fatal Message')