Issue Description
The log function is being called with parameters in the wrong order in some parts of the codebase. This causes errors to be logged at incorrect levels, potentially masking important errors as regular info logs.
Example Found
In src/controllers/llm.ts, the log function is called with the message first and level second:
log(`Error forwarding request: ${error.message}`, 'error')
The correct usage should be:
log('error', `Error forwarding request: ${error.message}`)
Required Action
- Review the entire codebase for all usages of the log function
- Ensure all calls follow the correct parameter order: log(level, message, error?)
- Fix any instances where parameters are swapped
- Consider adding TypeScript strict typing to prevent this issue in the future
Impact
When parameters are swapped, errors might be logged at INFO level instead of ERROR level, which can:
- Defeat alerting systems based on log levels
- Make troubleshooting difficult as critical errors are hidden among regular logs
- Lead to false negatives in monitoring
Links
Issue Description
The log function is being called with parameters in the wrong order in some parts of the codebase. This causes errors to be logged at incorrect levels, potentially masking important errors as regular info logs.
Example Found
In
src/controllers/llm.ts, the log function is called with the message first and level second:The correct usage should be:
Required Action
Impact
When parameters are swapped, errors might be logged at INFO level instead of ERROR level, which can:
Links