Skip to content

Commit

Permalink
Added logging configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Nov 10, 2024
1 parent 7c8e1a8 commit d6bdad4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Binary file modified inst/java/r2pmml-1.0-SNAPSHOT.jar
Binary file not shown.
12 changes: 12 additions & 0 deletions src/main/java/com/r2pmml/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
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 @@ -167,5 +169,15 @@ public 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);
}
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 d6bdad4

Please sign in to comment.