Skip to content

Commit 41863a6

Browse files
committed
fix(logger): bypass Console formatting in write() method
The write() method was using Console's internal _stdout stream which applies formatting like group indentation. This caused the test "should not apply indentation" to fail because write() was meant to output raw text without any formatting applied. Fixed by accessing the original stdout stream from constructor options when available, bypassing Console's internal formatting wrapper.
1 parent e69cd6d commit 41863a6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/logger.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,11 @@ export class Logger {
14161416
*/
14171417
write(text: string): this {
14181418
const con = privateConsole.get(this)
1419-
con._stdout.write(text)
1419+
// Write directly to the original stdout stream to bypass Console formatting
1420+
// (e.g., group indentation). If no custom stream was provided, fall back
1421+
// to con._stdout for compatibility.
1422+
const stdout = (this.#options.stdout as any) || con._stdout
1423+
stdout.write(text)
14201424
this[lastWasBlankSymbol](false)
14211425
return this
14221426
}

0 commit comments

Comments
 (0)