Skip to content

Commit b6e8463

Browse files
committed
only format if there are interpolation values
1 parent 916a3eb commit b6e8463

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/logger/src/logger.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ export class Logger implements AsyncDisposable {
204204

205205
attrs = shallowMergeAttributes(parseAttrs(this.#attrs), parseAttrs(attrs));
206206

207-
msg = msg ? format(msg, rest, { stringify: fastSafeStringify }) : msg;
207+
msg =
208+
msg && rest.length
209+
? format(msg, rest, { stringify: fastSafeStringify })
210+
: msg;
208211

209212
this.write(level, attrs, msg);
210213
if (truthyEnv('LOG_TRACE_LOGS')) {

0 commit comments

Comments
 (0)