-
Notifications
You must be signed in to change notification settings - Fork 2
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
Helper method for java root logger #10
Conversation
The variable confused me a bit.
I skipped one-lining so I could give it a descriptive name. |
What confused you btw? :) |
We change some global state, with the |
I don't know what a The better solution is probably to extract the code to a well named method in |
Yeah, wrapping it up in a method would improve it a bit. But I don't agree with your initial change. Just because you don't know what something is does not mean that you should remove them. See https://docs.oracle.com/javase/7/docs/api/java/util/logging/LogManager.html for reference (search for root) |
@walro WDYT? |
root_logger = Logger.get_logger("") | ||
|
||
# The first handler is by default the console | ||
root_logger.get_handlers.first.set_level(level) |
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.
hihi now you can oneline since you have descriptive method name :D
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.
I like the comment and with this it's slightly more clear where it applies :)
👍 |
@@ -1,8 +1,5 @@ | |||
require "spec_helper" | |||
|
|||
java_import java.util.logging.Logger | |||
java_import java.util.logging.Level |
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.
Maybe we should leave Level here, since we use it below. Suppose it's implicity added by the spec_helper
now
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.
Yes, all specs use spec_helper, so I don't think it's needed, we will just be repeating ourselves
Helper method for java root logger
The variable confused me a bit.