g-log-http-info
Advanced tools
Comparing version 0.2.9 to 0.3.0
@@ -9,7 +9,7 @@ 'use strict'; | ||
// [INFO] params = pathname, reqMethod, reqDate, reqStartTime, resStatus | ||
// [INFO] params = parsedUrl, reqMethod, reqDate, reqStartTime, resStatus | ||
function logToConsole(info) { | ||
var status = getResInfo(info.resStatus); | ||
var infoLines = [info.reqMethod + ' ' + info.pathname + ' ' + (info.parsedUrl.query || '') + ' ' + info.resStatus + ' ' + status.symbol, String(Date.now() - info.reqStartTime) + 'ms Response Time', String(info.reqDate)]; | ||
var infoLines = [info.reqMethod + ' ' + info.reqUri.pathname + ' ' + (info.reqUri.query || '') + ' ' + info.resStatus + ' ' + status.symbol, String(Date.now() - info.reqStartTime) + 'ms Response Time', String(info.reqDate)]; | ||
printInfo(status.color, infoLines); | ||
@@ -16,0 +16,0 @@ } |
{ | ||
"name": "g-log-http-info", | ||
"version": "0.2.9", | ||
"version": "0.3.0", | ||
"description": "Log HTTP requests and response to console or to log file depending on mode", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -5,3 +5,3 @@ 'use strict'; | ||
// [INFO] params = pathname, reqMethod, reqDate, reqStartTime, resStatus | ||
// [INFO] params = parsedUrl, reqMethod, reqDate, reqStartTime, resStatus | ||
@@ -11,4 +11,4 @@ export default function logToConsole(info) { | ||
const infoLines = [ | ||
`${info.reqMethod} ${info.pathname} ${ | ||
info.parsedUrl.query || ''} ${info.resStatus} ${status.symbol}`, | ||
`${info.reqMethod} ${info.reqUri.pathname} ${ | ||
info.reqUri.query || ''} ${info.resStatus} ${status.symbol}`, | ||
`${String(Date.now() - info.reqStartTime)}ms Response Time`, | ||
@@ -15,0 +15,0 @@ String(info.reqDate) |
4611