File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 22
33var logger = require ( 'restify-logger' ) ;
44
5- var filter = function filter ( req , res ) {
6- return process . env . NODE_ENV !== "test" && req . method !== "OPTIONS" ;
7- } ;
5+ logger . token ( 'user' , function ( req ) {
6+ return ( req . token && req . token . accountName || '???' ) + ':' ;
7+ } ) ;
88
9- var display = function display ( req , res ) {
10- return ( req . token && req . token . accountName ) ? req . token . accountName : '???' ;
11- } ;
9+ logger . token ( 'append' , function ( req , res ) {
10+ if ( res . statusCode >= 400 ) {
11+ return res . _body ;
12+ }
13+ return ' ' ;
14+ } ) ;
1215
13- module . exports = logger ( filter , display ) ;
16+ module . exports = logger ( 'custom' , {
17+ skip : function ( req ) {
18+ return process . env . NODE_ENV === "test" || req . method === "OPTIONS" ;
19+ }
20+ } ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " anyfetch-hydrater" ,
33 "description" : " Create hydrater for AnyFetch." ,
4- "version" : " 1.0.11 " ,
4+ "version" : " 1.0.12 " ,
55 "author" :
" Matthieu Bacconnier <[email protected] >" ,
66 "scripts" : {
77 "test" : " NODE_ENV=test mocha --recursive -R spec test/" ,
2020 "async" : " ^0.9.0" ,
2121 "rarity" : " ^2.1.1" ,
2222 "restify" : " ^2.8.1" ,
23- "restify-logger" : " ^1 .0.0 " ,
23+ "restify-logger" : " ^2 .0.1 " ,
2424 "supertest" : " ^0.13.0"
2525 },
2626 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments