Browse Source

Merge origin/JensV2 into JensV2

JensV2
Jens Schuhmann 1 year ago
parent
commit
5f9230815a
2 changed files with 2 additions and 10 deletions
  1. 1
    2
      src/bandit/Model/Wuerfel.java
  2. 1
    8
      src/bandit/util/OhmLogger.java

+ 1
- 2
src/bandit/Model/Wuerfel.java View File

import java.util.concurrent.SubmissionPublisher; import java.util.concurrent.SubmissionPublisher;
import java.util.logging.Logger; import java.util.logging.Logger;
import bandit.util.OhmLogger; import bandit.util.OhmLogger;
import java.util.HashSet;
import java.util.Set;



/** /**
* *

+ 1
- 8
src/bandit/util/OhmLogger.java View File

import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Set;
//import java.util.Properties;
import java.util.logging.*; import java.util.logging.*;


/** /**
Properties properties = new Properties(); Properties properties = new Properties();
properties.load(configFile); properties.load(configFile);
java.util.logging.Level classLogLevel = java.util.logging.Level.parse(properties.getProperty("log.level")); java.util.logging.Level classLogLevel = java.util.logging.Level.parse(properties.getProperty("log.level"));
ConsoleHandler ch = new ConsoleHandler(); ConsoleHandler ch = new ConsoleHandler();
ch.setFormatter(new OhmFormatter()); ch.setFormatter(new OhmFormatter());
lg.setUseParentHandlers(false); lg.setUseParentHandlers(false);
lg.getHandlers(); lg.getHandlers();
lg.addHandler(ch); lg.addHandler(ch);


lg.setLevel(classLogLevel); lg.setLevel(classLogLevel);
String logDirectory = properties.getProperty("log.directory"); String logDirectory = properties.getProperty("log.directory");
FileHandler fileHandler = new FileHandler(logDirectory + "/" + logFileName, true); FileHandler fileHandler = new FileHandler(logDirectory + "/" + logFileName, true);
fileHandler.setFormatter(new OhmFormatter()); fileHandler.setFormatter(new OhmFormatter());
lg.addHandler(fileHandler); lg.addHandler(fileHandler);
} else { } else {
System.err.println("Unable to find config.properties file. OhmLogger will use default settings."); System.err.println("Unable to find config.properties file. OhmLogger will use default settings.");
} }

Loading…
Cancel
Save