File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 1
1
import createLogger , { type LoggerOptions } from 'pino' ;
2
- import type { PrettyOptions } from 'pino-pretty' ;
3
2
4
- type BotLoggerOptions = LoggerOptions & {
5
- transport ?: { target : 'pino-pretty' ; options : PrettyOptions } ;
6
- } ;
7
-
8
- const developmentOptionsOverride : BotLoggerOptions = {
3
+ const developmentOptionsOverride : LoggerOptions = {
9
4
transport : {
10
- target : 'pino-pretty' ,
11
- options : {
12
- colorize : true ,
13
- } ,
5
+ target : './pinoTransportModule' ,
14
6
} ,
15
7
level : process . env [ 'LOGLEVEL' ] ?? 'debug' ,
16
8
} ;
Original file line number Diff line number Diff line change
1
+ import { red , white } from 'colorette' ;
2
+ import pretty from 'pino-pretty' ;
3
+
4
+ export default ( opts : Parameters < typeof pretty > ) =>
5
+ pretty ( {
6
+ ...opts ,
7
+ colorize : true ,
8
+ messageFormat : white ( `[${ red ( '{module}' ) } ] {msg}` ) ,
9
+ hideObject : true ,
10
+ ignore : 'pid,hostname' ,
11
+ } ) ;
Original file line number Diff line number Diff line change
1
+ //eslint-disable-next-line import/no-extraneous-dependencies
1
2
import { defineConfig } from 'tsup' ;
2
3
3
4
export default defineConfig ( {
4
5
clean : true ,
6
+ entry : {
7
+ main : 'src/main.ts' ,
8
+ pinoTransportModule : 'src/core/pinoTransportModule.ts' ,
9
+ } ,
5
10
format : [ 'esm' ] ,
6
11
keepNames : true ,
7
12
minify : true ,
You can’t perform that action at this time.
0 commit comments