🔍 feat: DEBUG_MESSAGE_LENGTH Environment Variable (pt. 2) (#10479)

This commit is contained in:
Danny Avila 2025-11-13 08:38:38 -05:00 committed by GitHub
parent 524fc5bae4
commit 6e19026c48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@ const SPLAT_SYMBOL = Symbol.for('splat');
const MESSAGE_SYMBOL = Symbol.for('message'); const MESSAGE_SYMBOL = Symbol.for('message');
const CONSOLE_JSON_STRING_LENGTH: number = const CONSOLE_JSON_STRING_LENGTH: number =
parseInt(process.env.CONSOLE_JSON_STRING_LENGTH || '', 10) || 255; parseInt(process.env.CONSOLE_JSON_STRING_LENGTH || '', 10) || 255;
const DEBUG_MESSAGE_LENGTH: number = parseInt(process.env.DEBUG_MESSAGE_LENGTH || '', 10) || 150;
const sensitiveKeys: RegExp[] = [ const sensitiveKeys: RegExp[] = [
/^(sk-)[^\s]+/, // OpenAI API key pattern /^(sk-)[^\s]+/, // OpenAI API key pattern
@ -125,7 +126,7 @@ const debugTraverse = winston.format.printf(
} }
const msgParts: string[] = [ const msgParts: string[] = [
`${timestamp} ${level}: ${truncateLongStrings(message.trim(), 150)}`, `${timestamp} ${level}: ${truncateLongStrings(message.trim(), DEBUG_MESSAGE_LENGTH)}`,
]; ];
try { try {