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

@meteor-it/logger

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meteor-it/logger - npm Package Compare versions

Comparing version 2.2.6 to 2.2.7

82

index.js
"use strict";
require("./colors");
let cluster = null;
if (process.env.__NODE__ !== 'undefined') {
cluster = require('cluster');
}
else {
cluster = {
isMaster: true,
isWorker: false,
on() { },
emit() { }
};
}
const DEBUG = process.env.DEBUG || '';

@@ -192,38 +180,31 @@ var LOGGER_ACTIONS;

static _write(what) {
if (cluster.isWorker) {
process.send({
loggerAction: what
});
}
else {
if (Logger.receivers.length === 0) {
if (!Logger.noReceiversWarned) {
console._log('No receivers are defined for logger! See docs for info about this!');
Logger.noReceiversWarned = true;
}
switch (what.type) {
case LOGGER_ACTIONS.DEBUG:
case LOGGER_ACTIONS.LOG:
console._log(what.line, ...what.params);
break;
case LOGGER_ACTIONS.ERROR:
console._error(what.line, ...what.params);
break;
case LOGGER_ACTIONS.WARNING:
console._warn(what.line, ...what.params);
break;
default:
console._log(what);
}
return;
if (Logger.receivers.length === 0) {
if (!Logger.noReceiversWarned) {
console._log('No receivers are defined for logger! See docs for info about this!');
Logger.noReceiversWarned = true;
}
if (Logger.isRepeating(what.name, what.line, what.type))
Logger.repeatCount++;
else
Logger.resetRepeating(what.name, what.line, what.type);
if (REPEATABLE_ACTIONS.indexOf(what.type) === -1)
what.repeats = Logger.repeatCount;
what.repeated = what.repeats && what.repeats > 0;
Logger.receivers.forEach(receiver => receiver.write(what));
switch (what.type) {
case LOGGER_ACTIONS.DEBUG:
case LOGGER_ACTIONS.LOG:
console._log(what.line, ...what.params);
break;
case LOGGER_ACTIONS.ERROR:
console._error(what.line, ...what.params);
break;
case LOGGER_ACTIONS.WARNING:
console._warn(what.line, ...what.params);
break;
default:
console._log(what);
}
return;
}
if (Logger.isRepeating(what.name, what.line, what.type))
Logger.repeatCount++;
else
Logger.resetRepeating(what.name, what.line, what.type);
if (REPEATABLE_ACTIONS.indexOf(what.type) === -1)
what.repeats = Logger.repeatCount;
what.repeated = what.repeats && what.repeats > 0;
Logger.receivers.forEach(receiver => receiver.write(what));
}

@@ -260,6 +241,9 @@ static resetRepeating(provider, message, type) {

loggerLogger = new Logger('logger');
for (let method of ['log', 'error', 'warn', 'err', 'warning']) {
console['_' + method] = console[method];
console[method] = (...args) => consoleLogger[method](...args);
if (!console._patchedByLogger) {
for (let method of ['log', 'error', 'warn', 'err', 'warning']) {
console['_' + method] = console[method];
console[method] = (...args) => consoleLogger[method](...args);
}
console._patchedByLogger = true;
}
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"name":"@meteor-it/logger","version":"2.2.6","description":"Most powerfull logger for node.js","main":"index.js","keywords":["meteor-it","logger"],"author":"Yaroslaw Bolyukin <iam@f6cf.pw> (http://f6cf.pw/)","license":"MIT","dependencies":{"@meteor-it/platform":"latest","@meteor-it/reflection":"latest","@meteor-it/terminal":"latest","@meteor-it/utils":"latest"}}
{"name":"@meteor-it/logger","version":"2.2.7","description":"Most powerfull logger for node.js","main":"index.js","keywords":["meteor-it","logger"],"author":"Yaroslaw Bolyukin <iam@f6cf.pw> (http://f6cf.pw/)","license":"MIT","dependencies":{"@meteor-it/platform":"latest","@meteor-it/reflection":"latest","@meteor-it/terminal":"latest","@meteor-it/utils":"latest"}}

Sorry, the diff of this file is not supported yet

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