-
Notifications
You must be signed in to change notification settings - Fork 566
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
Changes default logging to write to System.out. #1145
Conversation
/** | ||
* Logging handler that writes to {@link System#out} and uses a formatter that will replace {@code "!thread!"} substrings | ||
* with the current thread. | ||
*/ |
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.
How about: "A {@link StreamHandler} that writes to {@linkplain System#out standard out} and uses a {@link ThreadFormatter} for formatting purposes.
"
And: "@see ThreadFormatter
". Assuming it becomes public
of course.
public class HelidonConsoleHandler extends StreamHandler { | ||
|
||
/** | ||
* Constructor. |
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.
How about: "Creates a new {@link HelidonConsoleHandler}.
"
setFormatter(new ThreadFormatter()); | ||
} | ||
|
||
@Override |
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.
Probably worth documenting what you do in this method.
flush(); | ||
} | ||
|
||
@Override |
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.
Same as above.
flush(); | ||
} | ||
|
||
private static class ThreadFormatter extends SimpleFormatter { |
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.
This seems like a useful class in general; perhaps make it public
?
Fixes #1144.
Note that by setting the level in the handler to
Level.ALL,
the only levels that matter are those on the loggers, which is what nearly everyone expects.