File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 1
- const createLogger = require ( './logger ' ) ;
1
+ const bufflog = require ( '@bufferapp/bufflog ' ) ;
2
2
const onFinished = require ( 'on-finished' ) ;
3
3
const { getRequestDataToLog } = require ( './lib/utils' ) ;
4
4
@@ -10,7 +10,6 @@ const { getRequestDataToLog } = require('./lib/utils');
10
10
* @return {Function }
11
11
*/
12
12
module . exports = function middleware ( options ) {
13
- const logger = createLogger ( options ) ;
14
13
const {
15
14
getMetadata,
16
15
getStats,
@@ -47,7 +46,11 @@ module.exports = function middleware(options) {
47
46
stats,
48
47
} ;
49
48
50
- logger . info ( info , msg ) ;
49
+ if ( response . error ) {
50
+ bufflog . error ( msg , info ) ;
51
+ } else {
52
+ bufflog . info ( msg , info ) ;
53
+ }
51
54
} ) ;
52
55
53
56
next ( ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @bufferapp/logger" ,
3
- "version" : " 0.9.0 " ,
3
+ "version" : " 1.0.2 " ,
4
4
"description" : " Logging for Buffer.com's node applications" ,
5
5
"main" : " logger.js" ,
6
6
"scripts" : {
21
21
},
22
22
"license" : " MIT" ,
23
23
"dependencies" : {
24
- "bunyan" : " 1.8.1" ,
25
- "on-finished" : " 2.3.0" ,
26
- "fluent-logger" : " 2.2.0"
24
+ "@bufferapp/bufflog" : " 0.0.4" ,
25
+ "bunyan" : " ^1.8.12" ,
26
+ "fluent-logger" : " 2.2.0" ,
27
+ "on-finished" : " 2.3.0"
27
28
},
28
29
"devDependencies" : {
29
30
"chai" : " ^3.5.0" ,
33
34
"eslint-plugin-jsx-a11y" : " ^1.2.3" ,
34
35
"eslint-plugin-react" : " ^5.1.1" ,
35
36
"istanbul" : " ^0.4.3" ,
36
- "mocha" : " ^2.5.3 " ,
37
+ "mocha" : " ^7.1.0 " ,
37
38
"msgpack-lite" : " ^0.1.26"
38
39
}
39
40
}
You can’t perform that action at this time.
0 commit comments