-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
component: backendPull requests that update Go codePull requests that update Go codegood first issueGood for newcomersGood for newcomerslanguage: Gostatus: blockedtype: pedantic
Milestone
Description
Description
Expand logging coverage across the repository, service, and controller layers while maintaining clarity and avoiding duplication.
Logging exists in the project, but many parts of the codebase still lack proper log statements. To be effective, logging should:
- Use appropriate log levels.
- Avoid excessive or redundant logs.
- Be placed as low in the call stack as possible (closest to where the event happens).
- Never duplicate log entries for the same event.
Guidelines
- Log Levels
- Error → Failures, unexpected exceptions, and critical issues.
- Debug → Successful operations, diagnostic details, and development insights.
- Placement
- Log at the lowest relevant level in the codebase (e.g., repository for DB issues).
- Avoid logging the same event at higher levels unless absolutely necessary.
- Avoid Over-Logging
- Do not log trivial successes (e.g., “validation successful”).
- Only log what’s useful for understanding system behavior or diagnosing issues.
Example
Good:
- At the repository level:
- Log DB query failures at error level.
- Log successful DB operations at debug level.
Avoid:
- Logging repository errors again at the service level.
- Logging that a basic validation passed.
Tasks
- Identify repository, service, and controller functions without logging.
- Add logging following the guidelines above.
- Ensure no duplication of logs between layers.
- Test logging output to verify clarity and usefulness.
- Update unit tests for expecting log lines
Metadata
Metadata
Assignees
Labels
component: backendPull requests that update Go codePull requests that update Go codegood first issueGood for newcomersGood for newcomerslanguage: Gostatus: blockedtype: pedantic