diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2020-09-20 19:47:28 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2020-09-20 19:47:28 +0200 |
| commit | 58906d77975b35fe93569f8083b90140124f9c41 (patch) | |
| tree | 36ec38adf065424d547ef73d014913c503ab40fe /lib/loggers/file.js | |
| parent | 4b10e604bf4057d7ae8286151d7528d7d7ae1cb9 (diff) | |
Recover from npm package
Diffstat (limited to 'lib/loggers/file.js')
| -rw-r--r-- | lib/loggers/file.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/loggers/file.js b/lib/loggers/file.js deleted file mode 100644 index 0d60acd..0000000 --- a/lib/loggers/file.js +++ /dev/null @@ -1,48 +0,0 @@ -var fs = require('fs'); - -Class(Cobalt.Logger, 'File')({ - prototype : { - file : null, - formatterOpts : {}, - - init : function (config) { - if (config) { - for (property in config) { - this[property] = config[property]; - } - } - - this._stream = fs.createWriteStream(this.file, {flags: 'a'}); - }, - - log : function () { - var i, message = [], severity; - - for (i = 0; i < arguments.length; i++) { - // We're not formatting objects for now. - - if (!arguments[i].__skipConsole && !arguments[i].message.__skipConsole) { - message.push(this.format(arguments[i])); - if (!severity) { - severity = arguments[i]._level - } - } - } - - for (i = 0; i < message.length; i++) { - this._stream.write(message[i] + '\n'); - } - }, - - format : function (logObject) { - if (this.formatter) { - if (typeof logObject.message === 'object') { - return logObject.message; - } - return this.formatter.format(logObject, this.formatterOpts); - } - - return Cobalt.stringify(logObject); - } - } -}); |