Comparing version 2.0.16 to 2.0.18
@@ -5,8 +5,14 @@ | ||
NiceTime = require('./niceTime'), | ||
history = []; | ||
Cluster = require('cluster'); | ||
var clusterCPU = 'NODE_WORKER_ID' in process.env ? Style(Style.GREEN, process.env.NODE_WORKER_ID + '.') | ||
: 'CLUSTER_WORKER' in process.env ? Style(Style.GREEN, process.env.CLUSTER_WORKER + '.') | ||
var isWorker = Cluster.isWorker && Cluster.worker; | ||
var clusterCPU = isWorker ? Cluster.worker.id | ||
: 'CLUSTER_UNIQUE_ID' in process.env ? process.env.CLUSTER_UNIQUE_ID | ||
: 'NODE_WORKER_ID' in process.env ? process.env.NODE_WORKER_ID | ||
: 'CLUSTER_WORKER' in process.env ? process.env.CLUSTER_WORKER | ||
: ''; | ||
clusterCPU = clusterCPU ? Style(Style.GREEN, clusterCPU + '.') : ''; | ||
var TIMEZONE_OFFSET = (240 - (new Date).getTimezoneOffset()) * 60000; | ||
@@ -78,17 +84,5 @@ | ||
history.push({ | ||
date: date, | ||
niceTime: niceTime, | ||
file: file, | ||
messages: messages | ||
}); | ||
if (history.length > 100) { | ||
history = []; | ||
} | ||
} | ||
var Log = exports = module.exports = function Log() { | ||
return record(arguments); | ||
@@ -99,6 +93,4 @@ }; | ||
Log.from = function(path) { | ||
var file = path.split('/').pop().split('.')[0]; | ||
var log_function = function() { record(arguments, file); }; | ||
log_function.history = function(){ return history;}; | ||
log_function.array = function(array) { record(array, file);}; | ||
@@ -105,0 +97,0 @@ return log_function; |
{ | ||
"name": "logging", | ||
"version": "2.0.16", | ||
"version": "2.0.18", | ||
"description": "Super sexy color console logging with cluster support.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/dylang/logging", |
@@ -30,7 +30,7 @@ | ||
* Filename | ||
* Function Name | ||
* Cluster Worker id | ||
* Inspects arrays, objects, functions - all in color. | ||
* Stores history | ||
* Fast | ||
* Easy | ||
* Used in production on Node Knockout winner [Doodle or Die](http://DoodleOrDie.com). | ||
@@ -37,0 +37,0 @@ ## Todo |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
37059
175
6