2 * Created on Aug 21, 2003
7 * Simple Logging utility class used by the bridge components
12 import java.io.FileWriter;
13 import java.io.IOException;
14 import java.util.Date;
16 public class BridgeLogger {
18 //The logging text will be stored in this file
19 FileWriter general_log_;
21 //minimum severity level of a message to be logged
23 int min_log_level_ = 0;
26 * Create a new BridgeLogger which writes data to a file
29 * The path to the file which should be logged into
31 public BridgeLogger(String path) {
33 general_log_ = new FileWriter(path + "../sml/BridgeLog/general.txt");
34 log(1, "--------------------------");
35 log(1, "Server started on " + new Date());
36 log(1, "--------------------------");
37 } catch (IOException e) {
43 * Log general messages of bridge components in one file
48 * The message to be logged
50 public void log(int level, String msg) {
51 if (level > min_log_level_) {
53 general_log_.write(msg + "\n");
55 } catch (IOException e) {
62 * Close the logging file
67 } catch (IOException e) {
72 public int getMinLogLevel() {
73 return min_log_level_;
76 public void setMinLogLevel(int i) {