diff --git a/bower.json b/bower.json index 7a5b527..ae62783 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-logging", - "version": "1.0.0", + "version": "1.1.0", "description": "A minimal but effective logging mechanism with support for log levels and pluggable log appenders.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-logging.js b/dist/amd/aurelia-logging.js index 21d91e6..47a4c53 100644 --- a/dist/amd/aurelia-logging.js +++ b/dist/amd/aurelia-logging.js @@ -19,7 +19,6 @@ define(['exports'], function (exports) { }; var loggers = {}; - var currentLevel = logLevel.none; var appenders = []; var slice = Array.prototype.slice; var loggerConstructionKey = {}; @@ -38,7 +37,7 @@ define(['exports'], function (exports) { } function debug() { - if (currentLevel < 4) { + if (this.level < 4) { return; } @@ -46,7 +45,7 @@ define(['exports'], function (exports) { } function info() { - if (currentLevel < 3) { + if (this.level < 3) { return; } @@ -54,7 +53,7 @@ define(['exports'], function (exports) { } function warn() { - if (currentLevel < 2) { + if (this.level < 2) { return; } @@ -62,7 +61,7 @@ define(['exports'], function (exports) { } function error() { - if (currentLevel < 1) { + if (this.level < 1) { return; } @@ -101,13 +100,17 @@ define(['exports'], function (exports) { } function setLevel(level) { - currentLevel = level; + for (var key in loggers) { + loggers[key].setLevel(level); + } } var Logger = exports.Logger = function () { function Logger(id, key) { + this.level = logLevel.none; + if (key !== loggerConstructionKey) { throw new Error('Cannot instantiate "Logger". Use "getLogger" instead.'); } @@ -123,6 +126,10 @@ define(['exports'], function (exports) { Logger.prototype.error = function error(message) {}; + Logger.prototype.setLevel = function setLevel(level) { + this.level = level; + }; + return Logger; }(); }); \ No newline at end of file diff --git a/dist/aurelia-logging.d.ts b/dist/aurelia-logging.d.ts index 9a94105..5e38fb9 100644 --- a/dist/aurelia-logging.d.ts +++ b/dist/aurelia-logging.d.ts @@ -97,7 +97,7 @@ export declare function getLogger(id: string): Logger; export declare function addAppender(appender: Appender): void; /** -* Sets the level of logging for the application loggers. +* Sets the level of logging for ALL the application loggers. * * @param level Matches a value of logLevel specifying the level of logging. */ @@ -113,6 +113,11 @@ export declare class Logger { */ id: string; + /** + * The logging severity level for this logger + */ + level: number; + /** * You cannot instantiate the logger directly - you must use the getLogger method instead. */ @@ -149,4 +154,11 @@ export declare class Logger { * @param rest The data to log. */ error(message: string, ...rest: any[]): void; + + /** + * Sets the level of logging this logger + * + * @param level Matches a value of logLevel specifying the level of logging. + */ + setLevel(level: LogLevel): void; } \ No newline at end of file diff --git a/dist/aurelia-logging.js b/dist/aurelia-logging.js index 1a5ba42..b19f3f3 100644 --- a/dist/aurelia-logging.js +++ b/dist/aurelia-logging.js @@ -37,7 +37,6 @@ export const logLevel: LogLevel = { }; let loggers = {}; -let currentLevel = logLevel.none; let appenders = []; let slice = Array.prototype.slice; let loggerConstructionKey = {}; @@ -56,7 +55,7 @@ function log(logger, level, args) { } function debug() { - if (currentLevel < 4) { + if (this.level < 4) { return; } @@ -64,7 +63,7 @@ function debug() { } function info() { - if (currentLevel < 3) { + if (this.level < 3) { return; } @@ -72,7 +71,7 @@ function info() { } function warn() { - if (currentLevel < 2) { + if (this.level < 2) { return; } @@ -80,7 +79,7 @@ function warn() { } function error() { - if (currentLevel < 1) { + if (this.level < 1) { return; } @@ -167,12 +166,14 @@ export function addAppender(appender: Appender): void { } /** -* Sets the level of logging for the application loggers. +* Sets the level of logging for ALL the application loggers. * * @param level Matches a value of logLevel specifying the level of logging. */ export function setLevel(level: number): void { - currentLevel = level; + for (let key in loggers) { + loggers[key].setLevel(level); + } } /** @@ -184,6 +185,11 @@ export class Logger { */ id: string; + /** + * The logging severity level for this logger + */ + level: number = logLevel.none; + /** * You cannot instantiate the logger directly - you must use the getLogger method instead. */ @@ -226,4 +232,13 @@ export class Logger { * @param rest The data to log. */ error(message: string, ...rest: any[]): void {} + + /** + * Sets the level of logging this logger + * + * @param level Matches a value of logLevel specifying the level of logging. + */ + setLevel(level: LogLevel): void { + this.level = level; + } } diff --git a/dist/commonjs/aurelia-logging.js b/dist/commonjs/aurelia-logging.js index ac8066d..aee2d68 100644 --- a/dist/commonjs/aurelia-logging.js +++ b/dist/commonjs/aurelia-logging.js @@ -18,7 +18,6 @@ var logLevel = exports.logLevel = { }; var loggers = {}; -var currentLevel = logLevel.none; var appenders = []; var slice = Array.prototype.slice; var loggerConstructionKey = {}; @@ -37,7 +36,7 @@ function log(logger, level, args) { } function debug() { - if (currentLevel < 4) { + if (this.level < 4) { return; } @@ -45,7 +44,7 @@ function debug() { } function info() { - if (currentLevel < 3) { + if (this.level < 3) { return; } @@ -53,7 +52,7 @@ function info() { } function warn() { - if (currentLevel < 2) { + if (this.level < 2) { return; } @@ -61,7 +60,7 @@ function warn() { } function error() { - if (currentLevel < 1) { + if (this.level < 1) { return; } @@ -100,13 +99,17 @@ function addAppender(appender) { } function setLevel(level) { - currentLevel = level; + for (var key in loggers) { + loggers[key].setLevel(level); + } } var Logger = exports.Logger = function () { function Logger(id, key) { + this.level = logLevel.none; + if (key !== loggerConstructionKey) { throw new Error('Cannot instantiate "Logger". Use "getLogger" instead.'); } @@ -122,5 +125,9 @@ var Logger = exports.Logger = function () { Logger.prototype.error = function error(message) {}; + Logger.prototype.setLevel = function setLevel(level) { + this.level = level; + }; + return Logger; }(); \ No newline at end of file diff --git a/dist/es2015/aurelia-logging.js b/dist/es2015/aurelia-logging.js index 0494115..9fc3524 100644 --- a/dist/es2015/aurelia-logging.js +++ b/dist/es2015/aurelia-logging.js @@ -8,7 +8,6 @@ export const logLevel = { }; let loggers = {}; -let currentLevel = logLevel.none; let appenders = []; let slice = Array.prototype.slice; let loggerConstructionKey = {}; @@ -27,7 +26,7 @@ function log(logger, level, args) { } function debug() { - if (currentLevel < 4) { + if (this.level < 4) { return; } @@ -35,7 +34,7 @@ function debug() { } function info() { - if (currentLevel < 3) { + if (this.level < 3) { return; } @@ -43,7 +42,7 @@ function info() { } function warn() { - if (currentLevel < 2) { + if (this.level < 2) { return; } @@ -51,7 +50,7 @@ function warn() { } function error() { - if (currentLevel < 1) { + if (this.level < 1) { return; } @@ -90,11 +89,15 @@ export function addAppender(appender) { } export function setLevel(level) { - currentLevel = level; + for (let key in loggers) { + loggers[key].setLevel(level); + } } export let Logger = class Logger { constructor(id, key) { + this.level = logLevel.none; + if (key !== loggerConstructionKey) { throw new Error('Cannot instantiate "Logger". Use "getLogger" instead.'); } @@ -109,4 +112,8 @@ export let Logger = class Logger { warn(message, ...rest) {} error(message, ...rest) {} + + setLevel(level) { + this.level = level; + } }; \ No newline at end of file diff --git a/dist/native-modules/aurelia-logging.js b/dist/native-modules/aurelia-logging.js index ff09ba9..4edb406 100644 --- a/dist/native-modules/aurelia-logging.js +++ b/dist/native-modules/aurelia-logging.js @@ -9,7 +9,6 @@ export var logLevel = { }; var loggers = {}; -var currentLevel = logLevel.none; var appenders = []; var slice = Array.prototype.slice; var loggerConstructionKey = {}; @@ -28,7 +27,7 @@ function log(logger, level, args) { } function debug() { - if (currentLevel < 4) { + if (this.level < 4) { return; } @@ -36,7 +35,7 @@ function debug() { } function info() { - if (currentLevel < 3) { + if (this.level < 3) { return; } @@ -44,7 +43,7 @@ function info() { } function warn() { - if (currentLevel < 2) { + if (this.level < 2) { return; } @@ -52,7 +51,7 @@ function warn() { } function error() { - if (currentLevel < 1) { + if (this.level < 1) { return; } @@ -91,13 +90,17 @@ export function addAppender(appender) { } export function setLevel(level) { - currentLevel = level; + for (var key in loggers) { + loggers[key].setLevel(level); + } } export var Logger = function () { function Logger(id, key) { + this.level = logLevel.none; + if (key !== loggerConstructionKey) { throw new Error('Cannot instantiate "Logger". Use "getLogger" instead.'); } @@ -113,5 +116,9 @@ export var Logger = function () { Logger.prototype.error = function error(message) {}; + Logger.prototype.setLevel = function setLevel(level) { + this.level = level; + }; + return Logger; }(); \ No newline at end of file diff --git a/dist/system/aurelia-logging.js b/dist/system/aurelia-logging.js index f7491d8..42902c3 100644 --- a/dist/system/aurelia-logging.js +++ b/dist/system/aurelia-logging.js @@ -3,7 +3,7 @@ System.register([], function (_export, _context) { "use strict"; - var logLevel, loggers, currentLevel, appenders, slice, loggerConstructionKey, Logger; + var logLevel, loggers, appenders, slice, loggerConstructionKey, Logger; @@ -21,7 +21,7 @@ System.register([], function (_export, _context) { } function debug() { - if (currentLevel < 4) { + if (this.level < 4) { return; } @@ -29,7 +29,7 @@ System.register([], function (_export, _context) { } function info() { - if (currentLevel < 3) { + if (this.level < 3) { return; } @@ -37,7 +37,7 @@ System.register([], function (_export, _context) { } function warn() { - if (currentLevel < 2) { + if (this.level < 2) { return; } @@ -45,7 +45,7 @@ System.register([], function (_export, _context) { } function error() { - if (currentLevel < 1) { + if (this.level < 1) { return; } @@ -88,7 +88,9 @@ System.register([], function (_export, _context) { _export('addAppender', addAppender); function setLevel(level) { - currentLevel = level; + for (var key in loggers) { + loggers[key].setLevel(level); + } } _export('setLevel', setLevel); @@ -107,7 +109,6 @@ System.register([], function (_export, _context) { _export('logLevel', logLevel); loggers = {}; - currentLevel = logLevel.none; appenders = []; slice = Array.prototype.slice; loggerConstructionKey = {}; @@ -116,6 +117,8 @@ System.register([], function (_export, _context) { function Logger(id, key) { + this.level = logLevel.none; + if (key !== loggerConstructionKey) { throw new Error('Cannot instantiate "Logger". Use "getLogger" instead.'); } @@ -131,6 +134,10 @@ System.register([], function (_export, _context) { Logger.prototype.error = function error(message) {}; + Logger.prototype.setLevel = function setLevel(level) { + this.level = level; + }; + return Logger; }()); diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index ff56a03..605f08b 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.1.0 + +### Features + +* Individual loggers now have a `level` property that can be used to override the default log level. + # [1.0.0](https://github.com/aurelia/logging/compare/1.0.0-rc.1.0.1...v1.0.0) (2016-07-27) diff --git a/doc/api.json b/doc/api.json index e25389f..a52d79f 100644 --- a/doc/api.json +++ b/doc/api.json @@ -1 +1 @@ -{"name":"aurelia-logging","children":[{"id":25,"name":"Logger","kind":128,"kindString":"Class","flags":{"isExported":true},"comment":{"shortText":"A logger logs messages to a set of appenders, depending on the log level that is set."},"children":[{"id":27,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"comment":{"shortText":"You cannot instantiate the logger directly - you must use the getLogger method instead."},"signatures":[{"id":28,"name":"new Logger","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"shortText":"You cannot instantiate the logger directly - you must use the getLogger method instead."},"parameters":[{"id":29,"name":"id","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"instrinct","name":"string"}},{"id":30,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Object"}}],"type":{"type":"reference","name":"Logger","id":25}}]},{"id":26,"name":"id","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"The id that the logger was created with."},"type":{"type":"instrinct","name":"string"}},{"id":31,"name":"debug","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":32,"name":"debug","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Logs a debug message."},"parameters":[{"id":33,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The message to log."},"type":{"type":"instrinct","name":"string"}},{"id":34,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":43,"name":"error","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":44,"name":"error","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Logs an error."},"parameters":[{"id":45,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The message to log."},"type":{"type":"instrinct","name":"string"}},{"id":46,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":35,"name":"info","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":36,"name":"info","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Logs info."},"parameters":[{"id":37,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The message to log."},"type":{"type":"instrinct","name":"string"}},{"id":38,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":39,"name":"warn","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":40,"name":"warn","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Logs a warning."},"parameters":[{"id":41,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The message to log."},"type":{"type":"instrinct","name":"string"}},{"id":42,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Constructors","kind":512,"children":[27]},{"title":"Properties","kind":1024,"children":[26]},{"title":"Methods","kind":2048,"children":[31,43,35,39]}]},{"id":8,"name":"Appender","kind":256,"kindString":"Interface","flags":{"isExported":true},"comment":{"shortText":"Implemented by classes which wish to append log data to a target data store."},"children":[{"id":9,"name":"debug","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":10,"name":"debug","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Appends a debug log."},"parameters":[{"id":11,"name":"logger","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The source logger."},"type":{"type":"reference","name":"Logger","id":25}},{"id":12,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":21,"name":"error","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":22,"name":"error","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Appends an error log."},"parameters":[{"id":23,"name":"logger","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The source logger."},"type":{"type":"reference","name":"Logger","id":25}},{"id":24,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":13,"name":"info","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":14,"name":"info","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Appends an info log."},"parameters":[{"id":15,"name":"logger","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The source logger."},"type":{"type":"reference","name":"Logger","id":25}},{"id":16,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":17,"name":"warn","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":18,"name":"warn","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Appends a warning log."},"parameters":[{"id":19,"name":"logger","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The source logger."},"type":{"type":"reference","name":"Logger","id":25}},{"id":20,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Methods","kind":2048,"children":[9,21,13,17]}]},{"id":2,"name":"LogLevel","kind":256,"kindString":"Interface","flags":{"isExported":true},"comment":{"shortText":"Specifies the available logging levels."},"children":[{"id":7,"name":"debug","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Log all messages."},"type":{"type":"instrinct","name":"number"}},{"id":4,"name":"error","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Log only error messages."},"type":{"type":"instrinct","name":"number"}},{"id":6,"name":"info","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Log informational messages or above."},"type":{"type":"instrinct","name":"number"}},{"id":3,"name":"none","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"No logging."},"type":{"type":"instrinct","name":"number"}},{"id":5,"name":"warn","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Log warnings messages or above."},"type":{"type":"instrinct","name":"number"}}],"groups":[{"title":"Properties","kind":1024,"children":[7,4,6,3,5]}]},{"id":47,"name":"logLevel","kind":32,"kindString":"Variable","flags":{"isExported":true},"comment":{"shortText":"Specifies the available logging levels."},"type":{"type":"reference","name":"LogLevel","id":2}},{"id":51,"name":"addAppender","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":52,"name":"addAppender","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Adds an appender capable of processing logs and channeling them to an output."},"parameters":[{"id":53,"name":"appender","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"An appender instance to begin processing logs with.\n"},"type":{"type":"reference","name":"Appender","id":8}}],"type":{"type":"instrinct","name":"void"}}]},{"id":48,"name":"getLogger","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":49,"name":"getLogger","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Gets the instance of a logger associated with a particular id (or creates one if it doesn't already exist).","returns":"The instance of the logger, or creates a new logger if none exists for that id.\n"},"parameters":[{"id":50,"name":"id","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The id of the logger you wish to get an instance of."},"type":{"type":"instrinct","name":"string"}}],"type":{"type":"reference","name":"Logger","id":25}}]},{"id":54,"name":"setLevel","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":55,"name":"setLevel","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Sets the level of logging for the application loggers."},"parameters":[{"id":56,"name":"level","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"Matches a value of logLevel specifying the level of logging.\n"},"type":{"type":"instrinct","name":"number"}}],"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Classes","kind":128,"children":[25]},{"title":"Interfaces","kind":256,"children":[8,2]},{"title":"Variables","kind":32,"children":[47]},{"title":"Functions","kind":64,"children":[51,48,54]}]} \ No newline at end of file +{"name":"aurelia-logging","children":[{"id":25,"name":"Logger","kind":128,"kindString":"Class","flags":{"isExported":true},"comment":{"shortText":"A logger logs messages to a set of appenders, depending on the log level that is set."},"children":[{"id":28,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"comment":{"shortText":"You cannot instantiate the logger directly - you must use the getLogger method instead."},"signatures":[{"id":29,"name":"new Logger","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"shortText":"You cannot instantiate the logger directly - you must use the getLogger method instead."},"parameters":[{"id":30,"name":"id","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"instrinct","name":"string"}},{"id":31,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Object"}}],"type":{"type":"reference","name":"Logger","id":25}}]},{"id":26,"name":"id","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"The id that the logger was created with."},"type":{"type":"instrinct","name":"string"}},{"id":27,"name":"level","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"The logging severity level for this logger"},"type":{"type":"instrinct","name":"number"}},{"id":32,"name":"debug","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":33,"name":"debug","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Logs a debug message."},"parameters":[{"id":34,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The message to log."},"type":{"type":"instrinct","name":"string"}},{"id":35,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":44,"name":"error","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":45,"name":"error","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Logs an error."},"parameters":[{"id":46,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The message to log."},"type":{"type":"instrinct","name":"string"}},{"id":47,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":36,"name":"info","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":37,"name":"info","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Logs info."},"parameters":[{"id":38,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The message to log."},"type":{"type":"instrinct","name":"string"}},{"id":39,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":48,"name":"setLevel","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":49,"name":"setLevel","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Sets the level of logging this logger"},"parameters":[{"id":50,"name":"level","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"Matches a value of logLevel specifying the level of logging.\n"},"type":{"type":"reference","name":"LogLevel","id":2}}],"type":{"type":"instrinct","name":"void"}}]},{"id":40,"name":"warn","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":41,"name":"warn","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Logs a warning."},"parameters":[{"id":42,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The message to log."},"type":{"type":"instrinct","name":"string"}},{"id":43,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Constructors","kind":512,"children":[28]},{"title":"Properties","kind":1024,"children":[26,27]},{"title":"Methods","kind":2048,"children":[32,44,36,48,40]}]},{"id":8,"name":"Appender","kind":256,"kindString":"Interface","flags":{"isExported":true},"comment":{"shortText":"Implemented by classes which wish to append log data to a target data store."},"children":[{"id":9,"name":"debug","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":10,"name":"debug","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Appends a debug log."},"parameters":[{"id":11,"name":"logger","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The source logger."},"type":{"type":"reference","name":"Logger","id":25}},{"id":12,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":21,"name":"error","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":22,"name":"error","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Appends an error log."},"parameters":[{"id":23,"name":"logger","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The source logger."},"type":{"type":"reference","name":"Logger","id":25}},{"id":24,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":13,"name":"info","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":14,"name":"info","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Appends an info log."},"parameters":[{"id":15,"name":"logger","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The source logger."},"type":{"type":"reference","name":"Logger","id":25}},{"id":16,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]},{"id":17,"name":"warn","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":18,"name":"warn","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Appends a warning log."},"parameters":[{"id":19,"name":"logger","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The source logger."},"type":{"type":"reference","name":"Logger","id":25}},{"id":20,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"text":"The data to log.\n"},"type":{"type":"instrinct","isArray":true,"name":"any"}}],"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Methods","kind":2048,"children":[9,21,13,17]}]},{"id":2,"name":"LogLevel","kind":256,"kindString":"Interface","flags":{"isExported":true},"comment":{"shortText":"Specifies the available logging levels."},"children":[{"id":7,"name":"debug","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Log all messages."},"type":{"type":"instrinct","name":"number"}},{"id":4,"name":"error","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Log only error messages."},"type":{"type":"instrinct","name":"number"}},{"id":6,"name":"info","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Log informational messages or above."},"type":{"type":"instrinct","name":"number"}},{"id":3,"name":"none","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"No logging."},"type":{"type":"instrinct","name":"number"}},{"id":5,"name":"warn","kind":1024,"kindString":"Property","flags":{"isExported":true},"comment":{"shortText":"Log warnings messages or above."},"type":{"type":"instrinct","name":"number"}}],"groups":[{"title":"Properties","kind":1024,"children":[7,4,6,3,5]}]},{"id":51,"name":"logLevel","kind":32,"kindString":"Variable","flags":{"isExported":true},"comment":{"shortText":"Specifies the available logging levels."},"type":{"type":"reference","name":"LogLevel","id":2}},{"id":55,"name":"addAppender","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":56,"name":"addAppender","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Adds an appender capable of processing logs and channeling them to an output."},"parameters":[{"id":57,"name":"appender","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"An appender instance to begin processing logs with.\n"},"type":{"type":"reference","name":"Appender","id":8}}],"type":{"type":"instrinct","name":"void"}}]},{"id":52,"name":"getLogger","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":53,"name":"getLogger","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Gets the instance of a logger associated with a particular id (or creates one if it doesn't already exist).","returns":"The instance of the logger, or creates a new logger if none exists for that id.\n"},"parameters":[{"id":54,"name":"id","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"The id of the logger you wish to get an instance of."},"type":{"type":"instrinct","name":"string"}}],"type":{"type":"reference","name":"Logger","id":25}}]},{"id":58,"name":"setLevel","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":59,"name":"setLevel","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Sets the level of logging for ALL the application loggers."},"parameters":[{"id":60,"name":"level","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"Matches a value of logLevel specifying the level of logging.\n"},"type":{"type":"instrinct","name":"number"}}],"type":{"type":"instrinct","name":"void"}}]}],"groups":[{"title":"Classes","kind":128,"children":[25]},{"title":"Interfaces","kind":256,"children":[8,2]},{"title":"Variables","kind":32,"children":[51]},{"title":"Functions","kind":64,"children":[55,52,58]}]} \ No newline at end of file diff --git a/package.json b/package.json index 11dc8d2..efe752f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-logging", - "version": "1.0.0", + "version": "1.1.0", "description": "A minimal but effective logging mechanism with support for log levels and pluggable log appenders.", "keywords": [ "aurelia",