birdpack 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/server.js +14 -1
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -246,7 +246,20 @@ module.exports = class{
|
|
|
246
246
|
console.log(out);
|
|
247
247
|
}
|
|
248
248
|
traffic(c){
|
|
249
|
-
this.log('client',`${c.status} ${c.method} ${c.path} ${c.ip} ${c.get('user-agent')}`);
|
|
249
|
+
this.log('client',`${this.getFormattedDateTime()} ${c.status} ${c.method} ${c.path} ${c.ip} ${c.get('user-agent')}`);
|
|
250
|
+
}
|
|
251
|
+
getFormattedDateTime(){
|
|
252
|
+
let now = new Date();
|
|
253
|
+
|
|
254
|
+
let day = String(now.getDate()).padStart(2, '0');
|
|
255
|
+
let month = String(now.getMonth() + 1).padStart(2, '0');
|
|
256
|
+
let year = now.getFullYear();
|
|
257
|
+
|
|
258
|
+
let hours = String(now.getHours()).padStart(2, '0');
|
|
259
|
+
let minutes = String(now.getMinutes()).padStart(2, '0');
|
|
260
|
+
let seconds = String(now.getSeconds()).padStart(2, '0');
|
|
261
|
+
|
|
262
|
+
return `${day}-${month}-${year} ${hours}:${minutes}:${seconds}`;
|
|
250
263
|
}
|
|
251
264
|
|
|
252
265
|
powered(){
|