mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
Allow setting a log4j config file
This commit is contained in:
parent
21663c1033
commit
3c3610d9cc
@ -2943,10 +2943,24 @@ public class GUI extends Observable {
|
||||
* null
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
String logConfigFile = null;
|
||||
for (String element : args) {
|
||||
if (element.startsWith("-log4j=")) {
|
||||
String arg = element.substring("-log4j=".length());
|
||||
logConfigFile = arg;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// Configure logger
|
||||
if ((new File(LOG_CONFIG_FILE)).exists()) {
|
||||
if ( logConfigFile != null){
|
||||
if(new File(logConfigFile).exists()) {
|
||||
DOMConfigurator.configure(logConfigFile);
|
||||
} else {
|
||||
System.err.println("Failed to open " + logConfigFile);
|
||||
System.exit(1);
|
||||
}
|
||||
} else if ((new File(LOG_CONFIG_FILE)).exists()) {
|
||||
DOMConfigurator.configure(LOG_CONFIG_FILE);
|
||||
} else {
|
||||
// Used when starting from jar
|
||||
|
Loading…
Reference in New Issue
Block a user