keon94 opened a new issue, #3068: URL: https://github.com/apache/incubator-devlake/issues/3068
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Currently the codebase is filled with random usages of logger.Error(err, "msg"). Calls to this function must be done where the given "err" is not going to be returned back to the caller. Otherwise we keep spamming the logs with the same error over and over. Another use-case is when a parent logger creates a child logger using logger.Nested(). If an error happens at the child level, the function that created the child should print the error and not pass it up to the parent logger. ### Use case To summarize the description: 1. logger.Error(err, msg) with err != nil should be called when the err is not being returned to the caller 2. logger.Error(err, msg) with err != nil should be called at functions that create that logger. That err must not be returned back to the caller, but it's ok to create a new, non-wrapped error and pass that to the caller. Otherwise, logger.Error with err != nil should not be called because it'll lead to confusing and spammy log messages. ### Related issues _No response_ ### Are you willing to submit a PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
