Skip to content

Commit

Permalink
fix(grpc-sdk): wrapRouterFunctions request logging (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanidis committed May 13, 2022
1 parent 87351b5 commit 71cbb66
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions libraries/grpc-sdk/src/helpers/wrapRouterFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export function wrapCallObjectForRouter(call: any): ParsedRouterRequest {
}

function generateLog(routerRequest: boolean, requestReceive: number, call: any, status?: Status) {
console.log(
routerRequest ? 'Request: ' : 'Socket: ' +
routerRequest ? call.request.path : call.request.event +
(routerRequest ? 'socket: ' + call.request.socket : '') +
' ' +
status ?? '200' +
' ' +
(Date.now() - requestReceive),
);
let log = '';
if (routerRequest) {
log += `Request: ${call.request.path}`;
} else {
log += `Socket: ${call.request.event} socket: ${call.request.socket}`;
}
log += ` ${status ?? '200'} ${Date.now() - requestReceive}`;

console.log(log);
}

function parseRequestData(data: any) {
Expand Down

0 comments on commit 71cbb66

Please sign in to comment.