Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow exceptions to be logged as ERROR #236

Open
fandfisf opened this issue Nov 21, 2016 · 1 comment
Open

Allow exceptions to be logged as ERROR #236

fandfisf opened this issue Nov 21, 2016 · 1 comment

Comments

@fandfisf
Copy link

fandfisf commented Nov 21, 2016

For most projects, a typical structure is

  1. Method entry and exist are logged at low severity (DEBUG or INFO)
  2. Exceptions are logged as ERROR.

I believe this used to be the default behavior of @Loggable, however issue #149 changed that. I understand the motivations behind it, but for a typical case, this approach of logging everything at the same level does not help. We rarely want to log enter/exit at WARN or exceptions at DEBUG.
With that in mind I am proposing that we allow a flag for @Loggable to log exceptions as "ERROR". I am proposing a solutions and attaching a pull request.
This pull request introduces exceptionsAsError flag for @Loggable. This flag is set to false by default, and hence nothing will change on library upgrade, however one can take advantage of the flag if one wants.

@dmarkov
Copy link

dmarkov commented Nov 24, 2016

@yegor256 please do something about it, see par.21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants