Comparing version 4.0.0-rc0 to 4.0.0
@@ -7,3 +7,3 @@ "use strict"; | ||
module.exports = logFactory.instance(); | ||
module.exports.module = logFactory.module; | ||
module.exports.module = logFactory.module.bind( logFactory ); | ||
module.exports.to = stream => logFactory.instance().to( stream ); | ||
@@ -10,0 +10,0 @@ |
@@ -18,4 +18,6 @@ // jscs:disable requireNamedUnassignedFunctions | ||
* Construct a logger for the invoking module. | ||
* @param {String} [moduleName] The name to use for the logger. If none is provided, it will be determined automatically. | ||
* @param {Stream} [stream] The stream to write to. | ||
*/ | ||
module( moduleName ) { | ||
module( moduleName, stream ) { | ||
if( !moduleName ) { | ||
@@ -33,3 +35,3 @@ const error = new Error().stack; | ||
} | ||
return new Logger( moduleName ); | ||
return this.instance( moduleName, stream ); | ||
} | ||
@@ -43,7 +45,17 @@ | ||
const logger = new Logger( prefix, stream ); | ||
logger.enableLogging = !this.isSilent; | ||
this.__loggers.push( logger ); | ||
return logger; | ||
} | ||
silence( beSilent ) { | ||
beSilent = beSilent || true; | ||
LogFactory.isSilent = beSilent; | ||
this.__loggers.forEach( logger => { | ||
logger.enableLogging = !beSilent; | ||
} ); | ||
} | ||
} | ||
module.exports = new LogFactory(); |
{ | ||
"name": "fm-log", | ||
"version": "4.0.0-rc0", | ||
"version": "4.0.0", | ||
"description": "Console logging facility for Node", | ||
@@ -5,0 +5,0 @@ "main": "lib/log.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1169136
32
34510
1