Skip to content

Commit

Permalink
feat(logs): fix logs (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonp99 authored Nov 7, 2023
1 parent 87d1395 commit 3e526ed
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export class WinstonLogger implements IAppLogger {
private logger: TWinstonLogger;

constructor() {
const isProduction = process.env.ENVIRONMENT_NAME === 'production';
const isLocal = process.env.ENVIRONMENT_NAME === 'local';

const productionFormat = format.combine(format.timestamp(), format.json());
const jsonFormat = format.combine(format.timestamp(), format.json());

const developmentFormat = format.combine(
const prettyFormat = format.combine(
format.colorize({ all: true }),
format.timestamp(),
format.printf(({ timestamp, level, message, ...metadata }) => {
Expand All @@ -23,7 +23,7 @@ export class WinstonLogger implements IAppLogger {
);

this.logger = createLogger({
format: isProduction ? productionFormat : developmentFormat,
format: isLocal ? prettyFormat : jsonFormat,
transports: [new transports.Console()],
});
}
Expand Down

0 comments on commit 3e526ed

Please sign in to comment.