altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

fix: Snowflake SDK stdout log noise corrupts TUI display

Open anandgupta42 opened this issue 8 months ago • 0 comments

Bug

Snowflake SDK's internal Winston logger leaks JSON log lines to stdout during connection setup, corrupting the TUI display. This is the same root cause as #300.

Example noise:

{"level":"INFO","message":"[12:03:04.357 AM]: Configuring logger with level: -1, filePath: undefined, additionalLogToConsole: undefined"}

Root Cause

Two issues in snowflake-sdk v1.x:

  1. Ordering bug in core.js: Logger.info() fires BEFORE Logger.configure() applies logLevel: "OFF", so one INFO-level message leaks to stdout via Console transport (upstream: snowflakedb/snowflake-connector-nodejs#957, fixed in snowflakedb/snowflake-connector-nodejs#958)

  2. additionalLogToConsole defaults to true: Even with logLevel: "OFF", the Winston Console transport is created by default

Fix

  1. Set additionalLogToConsole: false in snowflake.configure() (defense-in-depth, credit: @saschabuehrle via #301)
  2. Bump snowflake-sdk peer dependency from ^1.0.0 to ^2.0.3 (upstream fix for the ordering bug)

References

  • snowflakedb/snowflake-connector-nodejs#794
  • snowflakedb/snowflake-connector-nodejs#957
  • snowflakedb/snowflake-connector-nodejs#1026

anandgupta42 avatar Mar 19 '26 09:03 anandgupta42