Skip to content

Commit

Permalink
fix(logger): logs show "%s" instead of replaced value #6020
Browse files Browse the repository at this point in the history
Problem:
Log messages have literal format strings such as "%s", even though
values were passed to the log function:

    2024-11-14 11:00:33.778 [info] CloudFormationTemplateRegistry: processed … %s
    2024-11-14 11:00:34.634 [debug] schema service: handle … -> %s

Solution:
Regression introduced by `TopicLogger`. Fix the call.
  • Loading branch information
justinmk3 authored Nov 14, 2024
1 parent 761bd3a commit 1d86309
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/shared/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export class TopicLogger extends BaseLogger implements vscode.Disposable {
if (typeof message === 'string') {
message = prependTopic(this.topic, message) as string
}
return this.logger.sendToLog(level, message, meta)
return this.logger.sendToLog(level, message, ...meta)
}

public async dispose(): Promise<void> {}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/test/testLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class TestLogger implements Logger {
.map((loggedEntry) => loggedEntry.entry)
}

public sendToLog(logLevel: LogLevel, msg: string, entries: Loggable[]): number {
public sendToLog(logLevel: LogLevel, msg: string, ...entries: Loggable[]): number {
return this.addLoggedEntries(logLevel, [msg, ...entries])
}

Expand Down

0 comments on commit 1d86309

Please sign in to comment.