-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add ability to log exceptions as error. #235
base: master
Are you sure you want to change the base?
Conversation
This chage does not break backwords compatibility.
Please help. The appVeyor check failed because maven path was set windows style. I have not checked in anything to change build platform/OS |
@fandfisf Let me find a reviewer for this pull request, thanks for submitting it |
@original-brownbear please review this PR |
@@ -194,6 +194,7 @@ private Object wrap(final ProceedingJoinPoint point, final Method method, | |||
new MethodLogger.Marker(point, annotation); | |||
this.running.add(marker); | |||
int level = annotation.value(); | |||
final int exceptionLevel = this.decideExceptionLevel(annotation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fandfisf we don't generally use compound method variable names, let's just leave this as level
:)
private int decideExceptionLevel(final Loggable annotation) { | ||
int returnValue = annotation.value(); | ||
if (annotation.exceptionsAsError()) { | ||
returnValue = Loggable.ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fandfisf very minor but you got two spaces behind the =
here, let's fix the formatting and make it just one space :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this before the "Loggable.ERROR"? Will fix that most likely this week-end.
@fandfisf thanks for the contribution. Removing that pid file def makes sense I think :) Only two minor points from my end. |
Will create an issue and will link to the PR description as you suggest. By the way, what is |
Created issue #236 |
Any update on this? |
@rultor merge |
@fandfisf @yegor256 Oops, I failed. You can see the full log here (spent 5min)
|
@rultor merge |
@fandfisf @yegor256 Oops, I failed. You can see the full log here (spent 7min)
|
@rultor merge |
@fandfisf @yegor256 Oops, I failed. You can see the full log here (spent 8min)
|
@fandfisf it seems that your code is not "clean" enough. Please, run your branch with |
See issue #236
This chage does not break backwords compatibility. The most common case is to log entry/exit at either INFO or DEBUG level, however, exceptions are usually logged as "ERROR". This allows the default behaviour to remain unchanged (exceptions logged at the same level as entry and exit) however for code-bases that do not use exceptions for flow control but as real exceptions, it allows them to be logged as ERROR. Hope this helps.
I also deleted a "pid" file in the root as it looked like an accidental check in. Pease discard the change if that is no the case.
Thanks!