Skip to content

Commit

Permalink
Konstantin/rka 34 add logging (#8)
Browse files Browse the repository at this point in the history
* rka-34: add logging

* rka-34: remove package lock

* fix: logger

* rka-34: add import
  • Loading branch information
konstrybakov authored Jun 15, 2024
1 parent c3e8371 commit ec9c921
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/logger.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import '@axiomhq/pino'
import { type TransportTargetOptions, pino } from 'pino'

const targets: TransportTargetOptions[] = [
{
target: 'pino-pretty',
options: {
colorize: true,
},
},
]
const targets: TransportTargetOptions[] = []

if (process.env.NODE_ENV === 'production') {
targets.push({
Expand All @@ -17,6 +11,13 @@ if (process.env.NODE_ENV === 'production') {
token: process.env.AXIOM_API_TOKEN,
},
})
} else {
targets.push({
target: 'pino-pretty',
options: {
colorize: true,
},
})
}

const transport = pino.transport({
Expand Down

0 comments on commit ec9c921

Please sign in to comment.