Skip to content

Commit b6edf08

Browse files
Make debug logging conditional on CODEEP_DEBUG
1 parent 373ceee commit b6edf08

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

src/utils/agent.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
import { ProjectContext } from './project';
88

9-
// Debug logging helper - always writes to log file, terminal output only when CODEEP_DEBUG=1
9+
// Debug logging helper - writes to log file when CODEEP_DEBUG=1
1010
import { logger } from './logger';
1111
const debug = (...args: unknown[]) => {
12-
logger.debug(args.map(String).join(' '));
1312
if (process.env.CODEEP_DEBUG === '1') {
14-
console.error('[DEBUG]', ...args);
13+
logger.debug(args.map(String).join(' '));
1514
}
1615
};
1716

src/utils/agentChat.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ import { logger } from './logger';
2828
export type { AgentChatResponse };
2929

3030
const debug = (...args: unknown[]) => {
31-
logger.debug(args.map(String).join(' '));
3231
if (process.env.CODEEP_DEBUG === '1') {
33-
console.error('[DEBUG]', ...args);
32+
logger.debug(args.map(String).join(' '));
3433
}
3534
};
3635

src/utils/agentStream.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import { parseOpenAIToolCalls, parseAnthropicToolCalls, parseToolCalls } from '.
99
import { ToolCall } from './tools';
1010
import { logger } from './logger';
1111

12-
// Debug logging helper - always writes to log file, terminal output only when CODEEP_DEBUG=1
12+
// Debug logging helper - writes to log file when CODEEP_DEBUG=1
1313
const debug = (...args: unknown[]) => {
14-
logger.debug(args.map(String).join(' '));
1514
if (process.env.CODEEP_DEBUG === '1') {
16-
console.error('[DEBUG]', ...args);
15+
logger.debug(args.map(String).join(' '));
1716
}
1817
};
1918

src/utils/toolExecution.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ import { ToolCall, ToolResult, ActionLog } from './tools';
1818
import { logger } from './logger';
1919

2020
const debug = (...args: unknown[]) => {
21-
logger.debug(args.map(String).join(' '));
2221
if (process.env.CODEEP_DEBUG === '1') {
23-
console.error('[DEBUG]', ...args);
22+
logger.debug(args.map(String).join(' '));
2423
}
2524
};
2625

src/utils/toolParsing.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import { ToolCall } from './tools';
99
import { logger } from './logger';
1010

1111
const debug = (...args: unknown[]) => {
12-
logger.debug(args.map(String).join(' '));
1312
if (process.env.CODEEP_DEBUG === '1') {
14-
console.error('[DEBUG]', ...args);
13+
logger.debug(args.map(String).join(' '));
1514
}
1615
};
1716

0 commit comments

Comments
 (0)