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

logg

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logg - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

.npmignore

33

lib/logger.js

@@ -111,3 +111,4 @@ /**

Logger.prototype.registerWatcher = function(watcher) {
this.on('', watcher);
var rootLogger = Logger.getSingleton();
rootLogger.on(this.name, watcher);
};

@@ -127,24 +128,20 @@

//
// * If message is loggable emit on global key from rootLogger.
// * If not rootLogger emit LEVEL event on instance and bubble up to and
// including rootLogger.
// * If not rootLogger emit Logger NAME event on instance and bubble up to and
// including rootLogger.
//
//
if (this.isLoggable(level)) {
rootLogger.emit('', logRecord);
// * Emit on global key from rootLogger.
// * Emit a LEVEL event on the rootLogger
// * For each name in the ancestor chain, emit an event of that name.
if (!this.isLoggable(level)) {
return
}
if (this.name) {
var name;
var logger = this;
rootLogger.emit(level, logRecord);
while (logger && rootLogger !== logger) {
name = logger.name
rootLogger.emit('', logRecord);
rootLogger.emit(level, logRecord);
var logger = this;
while (logger && rootLogger !== logger) {
var name = logger.name
if (name) {
rootLogger.emit(name, logRecord);
logger = logger.getParent();
}
logger = logger.getParent();
}
};

@@ -151,0 +148,0 @@

@@ -13,3 +13,7 @@

this.date = new Date;
this.message = this.getFormattedMessage();
this._formattedMessage = null;
Object.defineProperty(this, 'message', {
get: this.getFormattedMessage.bind(this)
});
}

@@ -27,4 +31,11 @@

LogRecord.prototype.getFormattedMessage = function () {
if (!this._formattedMessage) {
this._formattedMessage = this._getFormattedMessage()
}
return this._formattedMessage
}
LogRecord.prototype.getFormattedMessage = function () {
LogRecord.prototype._getFormattedMessage = function () {
var args = this.rawArgs.map(function(a) {

@@ -31,0 +42,0 @@ switch (typeof a) {

{
"name" : "logg",
"version" : "0.3.0",
"version" : "0.3.1",
"description" : "Logging library that allows for hierarchical loggers, multiple log levels, and flexible watching of log records.",

@@ -17,3 +17,9 @@ "keywords" : ["log", "logging", "logger", "hierarchical", "handler", "watcher"],

"main" : "./lib/logg.js",
"directories": {"lib": "./lib"}
"directories": {"lib": "./lib"},
"devDependencies": {
"nodeunit": "0.9.0"
},
"scripts": {
"test": "./node_modules/.bin/nodeunit lib/*_test.js"
}
}
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