Skip to content

Commit

Permalink
Added logging configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Oct 28, 2024
1 parent 8ca1d9f commit 4ca21ff
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Binary file modified sklearn2pmml/resources/sklearn2pmml-1.0-SNAPSHOT.jar
Binary file not shown.
12 changes: 12 additions & 0 deletions src/main/java/com/sklearn2pmml/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collection;
import java.util.List;
import java.util.logging.LogManager;

import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
Expand Down Expand Up @@ -147,6 +149,16 @@ private void run() throws Exception {
}
}

static {
LogManager logManager = LogManager.getLogManager();

try {
logManager.readConfiguration(Main.class.getResourceAsStream("/logging.properties"));
} catch(IOException ioe){
ioe.printStackTrace(System.err);
}
}

private static final Logger logger = Logger.getLogger(Main.class);

static {
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.level=INFO

handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter

java.util.logging.SimpleFormatter.format=%4$s: %5$s%6$s%n

0 comments on commit 4ca21ff

Please sign in to comment.