hologger-local
Advanced tools
Comparing version 0.0.2 to 1.0.0
@@ -9,17 +9,12 @@ var Streamer = require("hologger-streamer"); | ||
* | ||
* @api private | ||
* @api public | ||
* @inherits Streamer | ||
* | ||
* | ||
* @param {Object} library libreria de codigos empleada | ||
* @param {Nomber} isil identificador numerico de la libreria de | ||
* codigos empleada | ||
*/ | ||
function LocalStreamer(library, isil){ | ||
Streamer.call(this, library, isil); | ||
function LocalStreamer(){ | ||
Streamer.call(this); | ||
this._name = "LocalStreamer"; | ||
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.name = "LocalStreamer"; | ||
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; | ||
@@ -41,3 +36,3 @@ this._debugDrain = console.log; | ||
LocalStreamer.prototype = Object.create(Streamer.prototype); | ||
LocalStreamer.prototype.constructor = Streamer; | ||
LocalStreamer.prototype.constructor = LocalStreamer; | ||
@@ -49,16 +44,17 @@ | ||
* @description | ||
* Sobreescribe el metodo homonimo de la clase `Streamer`. | ||
* Sobreescribe el metodo homonimo de la clase `Streamer`, permitiendo cribar los | ||
* logs por un nivel minimo de serveridad. | ||
* | ||
* | ||
* @param {} gate | ||
* @param {} outlet | ||
* @param {Mixed} info | ||
*/ | ||
LocalStreamer.prototype._log = function(gate, info){ | ||
if ( this._logLevels.indexOf(info.severity) < this._minLogLevel ) return; | ||
LocalStreamer.prototype._log = function(outlet, info){ | ||
if ( this.logLevels.indexOf(info.severity) < this.minLogLevel ) return; | ||
//else: | ||
if (info && info.slug) gate(info.slug); | ||
if (info && info.slug) outlet(info.slug); | ||
if (info && info.err) { | ||
gate("====================ERR STACK BEGINS==================="); | ||
gate(info.err.stack); | ||
gate("====================ERR STACK ENDS==================="); | ||
outlet("====================ERR STACK BEGINS==================="); | ||
outlet(info.err.stack); | ||
outlet("====================ERR STACK ENDS==================="); | ||
} | ||
@@ -65,0 +61,0 @@ }; |
{ | ||
"name": "hologger-local", | ||
"version": "0.0.2", | ||
"version": "1.0.0", | ||
"description": "Local Streamer for Hologger", | ||
@@ -16,3 +16,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"hologger-streamer": "0.0.1" | ||
"hologger-streamer": "^1.0.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "scripts": { |
# hologger-local | ||
Azure Local Streamer for Hologger | ||
@@ -6,2 +7,3 @@ | ||
## Installation | ||
@@ -15,12 +17,16 @@ | ||
## Environmental variables | ||
```bash | ||
RACK_ENV= | ||
HOSTNAME= | ||
PORT= | ||
LOCAL_LOG_LEVEL= | ||
``` | ||
Ademas, este modulo se ve condicionado indirecto por la fijacion de las siguientes | ||
variables de entorno que configuran [Hologger](): | ||
```bash | ||
HOLOGGER_RIFS= | ||
HOLOGGER_RBFS= | ||
HOLOGGER_LOG_LEVEL= | ||
LOCAL_LOG_LEVEL= | ||
``` | ||
@@ -31,52 +37,4 @@ | ||
## Log Levels | ||
Mirror that of syslog, but reversing ordering: | ||
- `8` `EMERGENCY` system unusable | ||
- `7` `ALERT` immediate action required | ||
- `6` `CRITICAL` condition critical | ||
- `5` `ERROR` condition error | ||
- `4` `WARNING` condition warning | ||
- `3` `NOTICE` condition normal, but significant | ||
- `2` `INFO` a purely informational message | ||
- `1` `DEBUG` debugging information | ||
## Use | ||
La libreria permite su invocacion de cuatro formas indistintamente: | ||
+ `hologger(3, {foo: "bar"})` => la mas completa | ||
+ `hologger("some custom message")` => para mensajes sobre la marcha | ||
+ `hologger({foo: "bar"})` => igualmente sobre la marcha, pero con info estructurada | ||
+ `hologger(Error)` => logueo de errores | ||
En cualquier caso, se generara un codigo de error que, dependiendo del nivel | ||
de logueo tendra la siguiente apariencia. | ||
+ emergency; // 8xxxxxxx | ||
+ alert; // 7xxxxxxx | ||
+ critical; // 6xxxxxxx | ||
+ error; // 5xxxxxxx | ||
+ warning; // 4xxxxxxx | ||
+ notice; // 3xxxxxxx | ||
+ info; // 2xxxxxxx | ||
+ debug; // 1xxxxxxx | ||
## Caveats | ||
A fin de facilitar la operativa interna del logger, y de ser capaz de operar de | ||
la forma mas abstracta posible en el mayor numero de casos posible, `hologger` | ||
produce la estandarizacion interna del nombre de un numero de contado de propiedades | ||
de la informacion que se le presenta a logueo, siendo estas: | ||
+ `error` => `err` | ||
+ `request` => `req` | ||
## License | ||
MIT (see LICENSE file) |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
4002
54
37
+ Addedhologger-streamer@1.2.0(transitive)
+ Addedlodash.clone@4.5.0(transitive)
+ Addedlodash.isboolean@3.0.3(transitive)
+ Addedlodash.iserror@3.1.1(transitive)
+ Addedlodash.isnumber@3.0.3(transitive)
+ Addedlodash.isplainobject@4.0.6(transitive)
+ Addedlodash.isstring@4.0.1(transitive)
+ Addedlodash.unset@4.5.2(transitive)
- Removedhologger-streamer@0.0.1(transitive)
- Removedlodash@4.17.21(transitive)
Updatedhologger-streamer@^1.0.0