hologger-local
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -17,4 +17,4 @@ var Streamer = require("hologger-streamer"); | ||
this.description = "LocalStreamer constructor"; | ||
this.logLevels = ["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]; | ||
this.minLogLevel = process.env.LOCAL_LOG_LEVEL || process.env.HOLOGGER_LOG_LEVEL || 0; | ||
this._logLevels = ["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]; | ||
this._minLogLevel = process.env.HOLOGGER_LOCAL_LOG_LEVEL || this._minLogLevel || 0; | ||
@@ -43,12 +43,23 @@ this._debugDrain = console.log; | ||
* @description | ||
* Sobreescribe el metodo homonimo de la clase `Streamer`, permitiendo cribar los | ||
* logs por un nivel minimo de serveridad. | ||
* | ||
* Sobreescribe el metodo homonimo de la clase {Streamer}. | ||
* | ||
* @param {} outlet | ||
* @param {Mixed} info | ||
* Puesto que en entornos de desarrollo (development) solo se loguea un | ||
* mensaje que resume el evento (al contrario que en pre-produccion y en | ||
* produccion, donde se almacena como JSON toda la informacion del mismo), | ||
* en los casos en que el evento contenga un Object de tipo Error, ademas | ||
* del slug se loguea explicitamente el stack del Error, pues de otro modo se | ||
* pierde la informacion contenida en el mismo, vital para la depuracion | ||
* del mismo. | ||
* | ||
* | ||
* @param {Function} outlet Canal a traves del cual se producira el | ||
* volcado de datos. Debe tratarse por ello de un metodo o {Function} encargado | ||
* de la escritura de datos; es decir, que dada una informacion, produzca a su | ||
* invocacion el registro en algun soporte. Vgr, el metodo `log` de la API | ||
* `console` (`console.log`). Required. | ||
* @param {Mixed} info | ||
*/ | ||
LocalStreamer.prototype._log = function(outlet, info){ | ||
if ( this.logLevels.indexOf(info.severity) < this.minLogLevel ) return; | ||
//else: | ||
if (this._logLevels && this._logLevels.indexOf(info.severity) < this._minLogLevel) return; | ||
//else | ||
if (info && info.slug) outlet(info.slug); | ||
@@ -55,0 +66,0 @@ if (info && info.err) { |
{ | ||
"name": "hologger-local", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Local Streamer for Hologger", | ||
@@ -16,3 +16,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"hologger-streamer": "^1.0.0" | ||
"hologger-streamer": "^1.2.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "scripts": { |
# hologger-local | ||
Azure Local Streamer for Hologger | ||
Local Streamer for Hologger | ||
@@ -20,3 +20,3 @@ | ||
```bash | ||
LOCAL_LOG_LEVEL= | ||
HOLOGGER_LOCAL_LOG_LEVEL= | ||
``` | ||
@@ -23,0 +23,0 @@ |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
4764
65
1
Updatedhologger-streamer@^1.2.0