Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ImLunaHey committed May 4, 2023
1 parent 569dd07 commit 4aef7a8
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import winston from 'winston';
import winston, { format } from 'winston';
import { WinstonTransport as AxiomTransport } from '@axiomhq/axiom-node';
import chalk from 'chalk';
import * as pkg from '@app/../package.json';
import { serializeError } from 'serialize-error';
import { getCommitHash } from '@app/common/get-commit-hash';

export const globalLogger = winston.createLogger({
level: 'info',
format: winston.format.json({
replacer(key: string, value: unknown) {
if (key === 'error') return JSON.stringify(serializeError(value));
return value;
},
}),
format: format.combine(
format.errors({ stack: true }),
format.json()
),
defaultMeta: {
botName: pkg.name,
pid: process.pid,
Expand Down

0 comments on commit 4aef7a8

Please sign in to comment.