Back to all reviewers

Use appropriate logging levels

google-gemini/gemini-cli
Based on 2 comments
TypeScript

Use console.debug() for debug information instead of console.log() to prevent cluttering user-facing output. Debug information should be hidden from normal users but available when debugging is enabled.

Logging TypeScript

Reviewer Prompt

Use console.debug() for debug information instead of console.log() to prevent cluttering user-facing output. Debug information should be hidden from normal users but available when debugging is enabled.

When logging information that is primarily useful for developers or troubleshooting, use console.debug() rather than console.log(). This ensures that users don’t see unnecessary technical details during normal operation, while still making the information available when needed for debugging.

Example:

// Bad - users will see this debug information
console.log("buildImangeName:imageName ", imageName);
console.log(`Discovered tool: ${funcDecl.name}`);

// Good - debug information is properly categorized
console.debug("buildImangeName:imageName ", imageName);
console.debug(`Discovered tool: ${funcDecl.name}`);

This practice improves user experience by keeping the console output clean while maintaining valuable debugging capabilities for developers.

2
Comments Analyzed
TypeScript
Primary Language
Logging
Category

Source Discussions