logger4node
Advanced tools
Comparing version 1.0.18 to 1.0.19
{ | ||
"name": "logger4node", | ||
"version": "1.0.18", | ||
"version": "1.0.19", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -118,4 +118,10 @@ "use strict"; | ||
const [caller, filePath] = logSource.split(' ('); | ||
if (!filePath) { | ||
return ''; | ||
} | ||
const filePathSplit = filePath.substring(0, filePath.length - 1).split('/'); | ||
const [fileName, line, column] = filePathSplit.pop().split(':'); | ||
if (!fileName || !line || !column) { | ||
return ''; | ||
} | ||
return JSON.stringify({ | ||
@@ -131,2 +137,5 @@ caller: caller.split('at ')[1], | ||
const [fileName, line, column] = filePathSplit.pop().split(':'); | ||
if (!fileName || !line || !column) { | ||
return ''; | ||
} | ||
return JSON.stringify({ | ||
@@ -133,0 +142,0 @@ fileName, |
@@ -8,5 +8,5 @@ /// <reference types="node" /> | ||
export declare class Trace { | ||
static requestHandler(callback?: () => Omit<SessionInfo, 'sessionId'>): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void; | ||
static requestHandler(callback?: (req: http.IncomingMessage) => Omit<SessionInfo, 'sessionId'>): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void; | ||
static getSessionInfo(): SessionInfo; | ||
} | ||
export {}; |
@@ -10,3 +10,3 @@ "use strict"; | ||
return (req, res, next) => { | ||
asyncLocalStorage.run({ ...callback(), sessionId: (0, uuid_1.v4)() }, () => next()); | ||
asyncLocalStorage.run({ ...callback(req), sessionId: (0, uuid_1.v4)() }, () => next()); | ||
}; | ||
@@ -13,0 +13,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85461
891