aurelia-logging
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "aurelia-logging", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A minimal but effective logging mechanism with support for log levels and pluggable log appenders.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -25,2 +25,3 @@ define(['exports'], function (exports) { | ||
var loggerConstructionKey = {}; | ||
var globalDefaultLevel = logLevel.none; | ||
@@ -81,2 +82,3 @@ function log(logger, level, args) { | ||
var logger = new Logger(id, loggerConstructionKey); | ||
logger.setLevel(globalDefaultLevel); | ||
@@ -105,2 +107,3 @@ if (appenders.length) { | ||
function setLevel(level) { | ||
globalDefaultLevel = level; | ||
for (var key in loggers) { | ||
@@ -107,0 +110,0 @@ loggers[key].setLevel(level); |
@@ -159,7 +159,7 @@ | ||
/** | ||
* Sets the level of logging this logger | ||
* Sets the level of logging for this logger instance | ||
* | ||
* @param level Matches a value of logLevel specifying the level of logging. | ||
*/ | ||
setLevel(level: LogLevel): void; | ||
setLevel(level: number): void; | ||
} |
@@ -43,2 +43,3 @@ | ||
let loggerConstructionKey = {}; | ||
let globalDefaultLevel = logLevel.none; | ||
@@ -99,2 +100,3 @@ function log(logger, level, args) { | ||
let logger = new Logger(id, loggerConstructionKey); | ||
logger.setLevel(globalDefaultLevel); | ||
@@ -176,2 +178,3 @@ if (appenders.length) { | ||
export function setLevel(level: number): void { | ||
globalDefaultLevel = level; | ||
for (let key in loggers) { | ||
@@ -240,9 +243,9 @@ loggers[key].setLevel(level); | ||
/** | ||
* Sets the level of logging this logger | ||
* Sets the level of logging for this logger instance | ||
* | ||
* @param level Matches a value of logLevel specifying the level of logging. | ||
*/ | ||
setLevel(level: LogLevel): void { | ||
setLevel(level: number): void { | ||
this.level = level; | ||
} | ||
} |
@@ -24,2 +24,3 @@ 'use strict'; | ||
var loggerConstructionKey = {}; | ||
var globalDefaultLevel = logLevel.none; | ||
@@ -80,2 +81,3 @@ function log(logger, level, args) { | ||
var logger = new Logger(id, loggerConstructionKey); | ||
logger.setLevel(globalDefaultLevel); | ||
@@ -104,2 +106,3 @@ if (appenders.length) { | ||
function setLevel(level) { | ||
globalDefaultLevel = level; | ||
for (var key in loggers) { | ||
@@ -106,0 +109,0 @@ loggers[key].setLevel(level); |
@@ -14,2 +14,3 @@ | ||
let loggerConstructionKey = {}; | ||
let globalDefaultLevel = logLevel.none; | ||
@@ -70,2 +71,3 @@ function log(logger, level, args) { | ||
let logger = new Logger(id, loggerConstructionKey); | ||
logger.setLevel(globalDefaultLevel); | ||
@@ -94,2 +96,3 @@ if (appenders.length) { | ||
export function setLevel(level) { | ||
globalDefaultLevel = level; | ||
for (let key in loggers) { | ||
@@ -96,0 +99,0 @@ loggers[key].setLevel(level); |
@@ -15,2 +15,3 @@ | ||
var loggerConstructionKey = {}; | ||
var globalDefaultLevel = logLevel.none; | ||
@@ -71,2 +72,3 @@ function log(logger, level, args) { | ||
var logger = new Logger(id, loggerConstructionKey); | ||
logger.setLevel(globalDefaultLevel); | ||
@@ -95,2 +97,3 @@ if (appenders.length) { | ||
export function setLevel(level) { | ||
globalDefaultLevel = level; | ||
for (var key in loggers) { | ||
@@ -97,0 +100,0 @@ loggers[key].setLevel(level); |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var logLevel, loggers, appenders, slice, loggerConstructionKey, Logger; | ||
var logLevel, loggers, appenders, slice, loggerConstructionKey, globalDefaultLevel, Logger; | ||
@@ -65,2 +65,3 @@ | ||
var logger = new Logger(id, loggerConstructionKey); | ||
logger.setLevel(globalDefaultLevel); | ||
@@ -93,2 +94,3 @@ if (appenders.length) { | ||
function setLevel(level) { | ||
globalDefaultLevel = level; | ||
for (var key in loggers) { | ||
@@ -118,2 +120,3 @@ loggers[key].setLevel(level); | ||
loggerConstructionKey = {}; | ||
globalDefaultLevel = logLevel.none; | ||
@@ -120,0 +123,0 @@ _export('Logger', Logger = function () { |
@@ -1,1 +0,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":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]}]} | ||
{"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 for this logger instance"},"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":"instrinct","name":"number"}}],"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]}]} |
@@ -0,1 +1,12 @@ | ||
<a name="1.1.1"></a> | ||
## [1.1.1](https://github.com/aurelia/logging/compare/1.1.0...v1.1.1) (2016-11-08) | ||
### Bug Fixes | ||
* **logging:** carry a globalDefaultLevel with which subsequent loggers are created ([ec9af2a](https://github.com/aurelia/logging/commit/ec9af2a)) | ||
* **logging:** relax type on Logger.setLevel() for compatibility with TypeScript ([d52bec2](https://github.com/aurelia/logging/commit/d52bec2)) | ||
# 1.1.0 | ||
@@ -2,0 +13,0 @@ |
{ | ||
"name": "aurelia-logging", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A minimal but effective logging mechanism with support for log levels and pluggable log appenders.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -42,2 +42,3 @@ /** | ||
let loggerConstructionKey = {}; | ||
let globalDefaultLevel = logLevel.none; | ||
@@ -98,2 +99,3 @@ function log(logger, level, args) { | ||
let logger = new Logger(id, loggerConstructionKey); | ||
logger.setLevel(globalDefaultLevel); | ||
@@ -175,2 +177,3 @@ if (appenders.length) { | ||
export function setLevel(level: number): void { | ||
globalDefaultLevel = level; | ||
for (let key in loggers) { | ||
@@ -239,9 +242,9 @@ loggers[key].setLevel(level); | ||
/** | ||
* Sets the level of logging this logger | ||
* Sets the level of logging for this logger instance | ||
* | ||
* @param level Matches a value of logLevel specifying the level of logging. | ||
*/ | ||
setLevel(level: LogLevel): void { | ||
setLevel(level: number): void { | ||
this.level = level; | ||
} | ||
} |
@@ -186,3 +186,9 @@ import * as LogManager from '../src/index'; | ||
}); | ||
it('carries a global logLevel with which all created loggers are initialized', () => { | ||
LogManager.setLevel(LogManager.logLevel.debug); | ||
var logger2 = LogManager.getLogger('test2'); | ||
expect(logger2.level).toBe(LogManager.logLevel.debug); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143417
2156