Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fm-log

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fm-log - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

4

lib/LogFactory.js

@@ -22,3 +22,3 @@ // jscs:disable requireNamedUnassignedFunctions

module( moduleName, stream ) {
if( !moduleName ) {
if( !moduleName && moduleName !== "" ) {
const error = new Error().stack;

@@ -52,3 +52,3 @@ const matches = error.match( /at (?:Context|Object).<anonymous> .*[\\/](.*?):/ );

LogFactory.isSilent = beSilent;
this.isSilent = beSilent;
this.__loggers.forEach( logger => {

@@ -55,0 +55,0 @@ logger.enableLogging = !beSilent;

{
"name": "fm-log",
"version": "4.0.1",
"version": "4.0.2",
"description": "Console logging facility for Node",

@@ -5,0 +5,0 @@ "main": "lib/log.js",

@@ -60,2 +60,8 @@ "use strict";

} );
it( "should create an unprefixed logger", () => {
log = require( "../lib/log.js" ).module( "" ).to( logStream );
log.debug( "!" );
result[ 0 ].should.match( /\d \[DEBUG ] !/ );
} );
} );

@@ -219,2 +225,17 @@

} );
describe( "silence", () => {
it( "shouldn't log when silenced", () => {
log = require( "../lib/log.js" ).module( "" ).to( logStream ).off();
log.info( "!" );
result.should.have.length( 0 );
} );
it( "shouldn't log when globally silenced", () => {
require( "../lib/log.js" ).logFactory.silence();
log = require( "../lib/log.js" ).module( "" ).to( logStream );
log.info( "!" );
result.should.have.length( 0 );
} );
} );
} );
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc