Skip to content

Commit

Permalink
fix(common): check if get timestamp is present on logger
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jan 26, 2021
1 parent 667df81 commit c48e2bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common/services/logger.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class Logger implements LoggerService {
const contextMessage = context ? yellow(`[${context}] `) : '';
const timestampDiff = this.updateAndGetTimestampDiff(isTimeDiffEnabled);
const instance = (this.instance as typeof Logger) ?? Logger;
const computedMessage = `${pidMessage}${instance.getTimestamp()} ${contextMessage}${output}${timestampDiff}\n`;
const computedMessage = `${pidMessage}${instance.getTimestamp?.()} ${contextMessage}${output}${timestampDiff}\n`;

process[writeStreamType ?? 'stdout'].write(computedMessage);
}
Expand Down

0 comments on commit c48e2bc

Please sign in to comment.