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 d5b5695 commit a9c2382
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import * as winston from 'winston';
import { WinstonTransport as AxiomTransport } from '@axiomhq/axiom-node';
import chalk from 'chalk';
import { serializeError } from 'serialize-error';
import * as pkg from '@app/../package.json';
import { getCommitHash } from '@app/common/get-commit-hash';
import { format } from 'winston';

export const globalLogger = winston.createLogger({
level: 'info',
format: winston.format.json({
replacer(_key: string, value: unknown) {
if (value instanceof Error) return 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 a9c2382

Please sign in to comment.