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 | bfd26c004f1bbc07f049013ab4e8de970e14341f (patch) | |
| tree | 800cb1fc34dd696360588151ff39f505d548ee8c /lib/loggers/file.js | |
| parent | 3691a033c39f88886b8467c14f33245dc1193c8d (diff) | |
Recover from npm packagev1.1.0
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); - } - } -}); |