-
Notifications
You must be signed in to change notification settings - Fork 2k
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
PUBDEV-7073 extended logging possibilities #4109
Conversation
h2o-genmodel/src/main/java/hex/genmodel/algos/tree/SharedTreeNode.java
Outdated
Show resolved
Hide resolved
7106068
to
541393b
Compare
h2o-genmodel/src/main/java/hex/genmodel/algos/tree/SharedTreeMojoModel.java
Outdated
Show resolved
Hide resolved
h2o-genmodel/src/main/java/hex/genmodel/algos/tree/SharedTreeNode.java
Outdated
Show resolved
Hide resolved
7b9e13a
to
efefd54
Compare
efefd54
to
d209db4
Compare
* @return Slf4JLogger if SLF4J is on the classpath, ConsoleLogger if not | ||
*/ | ||
public Logger getCustomLogger(Class<?> clazz) { | ||
if (isSlf4JAvailable) { |
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.
can we make the decision just once?
IMHO better for the MOJO use case
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 is done once per class static-init so one if() is not a big issue I think
d209db4
to
83ba402
Compare
@koniecsveta looks good, please change the base branch to master also I realized: we should also delegate to @koniecsveta @honzasterba WDYT? |
* @return Slf4JLogger if SLF4J is on the classpath, ConsoleLogger if not | ||
*/ | ||
public Logger getCustomLogger(Class<?> clazz) { | ||
if (isSlf4JAvailable) { |
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 is done once per class static-init so one if() is not a big issue I think
private static final String DEFAULT_CLASS_TO_CHECK = "org.slf4j.LoggerFactory"; | ||
private static final LoggerFactory INSTANCE = new LoggerFactory(DEFAULT_CLASS_TO_CHECK); | ||
|
||
private final String slf4jClassName; |
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.
we could extend this with waterClassName and look for water.util.Log if slf4j is not found
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.
making it this way we get circular dependency between modules with different language levels assigned: genmodel(7)->core(8)->logger(7)->genmodel(7).
ea54ec0
to
0e00a5e
Compare
when creating a hex.genmodel.easy.EasyPredictModelWrapper enableContributions parameter is false by default already.