diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-01-31 11:23:52 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-01-31 11:23:52 +0100 |
commit | c45f7f84001c2731909db04dd82e1c1f290386eb (patch) | |
tree | b7e57420a1f65dfbbacc1a532bf489c9bea6125d /helpers/logger.js | |
parent | cda021079ff455cc0fd0eb95a5395fa808ab63d1 (diff) | |
download | PeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.tar.gz PeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.tar.zst PeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.zip |
Infile code reorganization
Diffstat (limited to 'helpers/logger.js')
-rw-r--r-- | helpers/logger.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/helpers/logger.js b/helpers/logger.js index 850af10cb..fa5b53708 100644 --- a/helpers/logger.js +++ b/helpers/logger.js | |||
@@ -4,11 +4,9 @@ | |||
4 | 4 | ||
5 | var config = require('config') | 5 | var config = require('config') |
6 | var winston = require('winston') | 6 | var winston = require('winston') |
7 | |||
8 | var logDir = __dirname + '/../' + config.get('storage.logs') | ||
9 | |||
10 | winston.emitErrs = true | 7 | winston.emitErrs = true |
11 | 8 | ||
9 | var logDir = __dirname + '/../' + config.get('storage.logs') | ||
12 | var logger = new winston.Logger({ | 10 | var logger = new winston.Logger({ |
13 | transports: [ | 11 | transports: [ |
14 | new winston.transports.File({ | 12 | new winston.transports.File({ |
@@ -31,10 +29,13 @@ | |||
31 | exitOnError: true | 29 | exitOnError: true |
32 | }) | 30 | }) |
33 | 31 | ||
34 | module.exports = logger | 32 | logger.stream = { |
35 | module.exports.stream = { | ||
36 | write: function (message, encoding) { | 33 | write: function (message, encoding) { |
37 | logger.info(message) | 34 | logger.info(message) |
38 | } | 35 | } |
39 | } | 36 | } |
37 | |||
38 | // --------------------------------------------------------------------------- | ||
39 | |||
40 | module.exports = logger | ||
40 | })() | 41 | })() |