feat: apply createCallLogIdentifyMessage on return log
This commit is contained in:
parent
6ddab9d2be
commit
8f8d56ada4
@ -172,8 +172,6 @@ const callLogIdentifyMessageDictionary: Record<BuildType, string> = {
|
|||||||
middleware: 'MIDDLEWARE',
|
middleware: 'MIDDLEWARE',
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCallLogIdentifyMessage(message: 'HIT' | 'RETURNED', type: 'guard' | 'interceptor' | 'middleware' | 'route', key: string, route: string)
|
|
||||||
function createCallLogIdentifyMessage(message: 'HIT' | 'RETURNED', type: 'function', key: string)
|
|
||||||
function createCallLogIdentifyMessage(message: 'HIT' | 'RETURNED', type: BuildType, key?: string, route?: string) {
|
function createCallLogIdentifyMessage(message: 'HIT' | 'RETURNED', type: BuildType, key?: string, route?: string) {
|
||||||
if (type === 'guard' || type === 'interceptor' || type === 'middleware' || type === 'route')
|
if (type === 'guard' || type === 'interceptor' || type === 'middleware' || type === 'route')
|
||||||
return `${message} ${callLogIdentifyMessageDictionary[type]} ${key} (${route})`
|
return `${message} ${callLogIdentifyMessageDictionary[type]} ${key} (${route})`
|
||||||
@ -321,11 +319,7 @@ function overrideBuild<F extends Array<any>, R>(
|
|||||||
: "WITH " + r
|
: "WITH " + r
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
injectedLogger[logged.options.returnLogLevel](
|
injectedLogger[logged.options.returnLogLevel](`${createCallLogIdentifyMessage('RETURNED', type, key, route)} ${resultLogged}`);
|
||||||
route
|
|
||||||
? `RETURNED HTTP ${route} (${key}) ${resultLogged}`
|
|
||||||
: `RETURNED ${key} ${resultLogged}`
|
|
||||||
);
|
|
||||||
return r;
|
return r;
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -348,11 +342,7 @@ function overrideBuild<F extends Array<any>, R>(
|
|||||||
: "WITH " + r
|
: "WITH " + r
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
injectedLogger[logged.options.returnLogLevel](
|
injectedLogger[logged.options.returnLogLevel](`${createCallLogIdentifyMessage('RETURNED', type, key, route)} ${resultLogged}`);
|
||||||
route
|
|
||||||
? `RETURNED HTTP ${route} (${key}) ${resultLogged}`
|
|
||||||
: `RETURNED ${key} ${resultLogged}`
|
|
||||||
);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user