Skip to content

Commit

Permalink
fix(logger): standardize module name formatting to uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Jan 27, 2025
1 parent c373290 commit dfa47a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export function customFormat(noColor = false): winston.Logform.Format {
// must be added at last
formats.push(
printf((info) => {
info.module = info.module?.toUpperCase() || '-'
if (!noColor) {
info.timestamp = colorizer.colorize('time', info.timestamp)
info.module = colorizer.colorize('module', info.module)
Expand Down Expand Up @@ -185,10 +184,11 @@ export function setupLogger(
const sanitized = sanitizedConfig(module, config)
// Winston automatically reuses an existing module logger
const logger = container.add(module) as ModuleLogger
const moduleName = module.toUpperCase() || '-'
logger.configure({
format: combine(
format((info) => {
info.module = logger.module
info.module = moduleName
return info
})(),
format.errors({ stack: true }),
Expand Down

0 comments on commit dfa47a9

Please sign in to comment.