| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 157cd5f commit 11efdf3
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,25 @@ | |||
| 1 | + import pino from 'pino'; | ||
| 2 | + import { PinoPretty } from "pino-pretty"; | ||
| 3 | + | ||
| 4 | + export const logger = pino({ | ||
| 5 | + transport: { | ||
| 6 | + target: 'pino-pretty', | ||
| 7 | + options: { | ||
| 8 | + colorize: true, | ||
| 9 | + ignore: 'pid,hostname', | ||
| 10 | + hideObject: true, | ||
| 11 | + messageFormat: '[{level}] ({layer}) {msg}', | ||
| 12 | + } | ||
| 13 | + }, | ||
| 14 | + level: process.env.HEAVY_DEBUG ? 'trace' : ( process.env.DEBUG_LEVEL || 'info' ) | ||
| 15 | + }); | ||
| 16 | + | ||
| 17 | + export const afLogger = logger.child( | ||
| 18 | + { layer: 'adminforth' }, | ||
| 19 | + { level: process.env.HEAVY_DEBUG ? 'trace' : ( process.env.DEBUG_LEVEL || 'info' ) } | ||
| 20 | + ); | ||
| 21 | + | ||
| 22 | + export const dbLogger = logger.child( | ||
| 23 | + { layer: 'db' }, | ||
| 24 | + { level: process.env.HEAVY_DEBUG_QUERY ? 'trace' : (process.env.DEBUG_LEVEL_DB_QUERY || 'info') } | ||
| 25 | + ); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments