altimate-code
altimate-code copied to clipboard
fix: Snowflake SDK stdout log noise corrupts TUI display
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:
-
Ordering bug in
core.js:Logger.info()fires BEFORELogger.configure()applieslogLevel: "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) -
additionalLogToConsoledefaults totrue: Even withlogLevel: "OFF", the Winston Console transport is created by default
Fix
- Set
additionalLogToConsole: falseinsnowflake.configure()(defense-in-depth, credit: @saschabuehrle via #301) - Bump
snowflake-sdkpeer dependency from^1.0.0to^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