📄 launchlogger.java
字号:
package de.fhm.jkf.launch.clsv;
/*
* $Log: LaunchLogger.java,v $
* Revision 1.1 2003/01/16 13:09:48 mwulff
* initial version
*
* Revision 1.2 2003/01/07 15:00:24 willaxt
* adjusted to new LogLevel enum
*
* Revision 1.1 2002/12/28 14:32:31 willaxt
* simple and small logger for the launcher classes
*
*/
/**
*
*
* @author Theodor Willax
*
* <br><br><center><table border="1" width="80%"><hr>
* <strong><a href="http://jkf.sourceforge.net">The JKF Project</a></strong>
* <p>
* Copyright (C) 2002 by Theodor Willax
* <p>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* <p>
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* <p>
* You should have received a copy of the <a href="http://www.gnu.org/copyleft/lesser.html">
* GNU Lesser General Public License</a> along with this library; if not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
* <hr></table></center>
*
* Very, very simple logging class for the launcher. Nothing special is done.
* Only <code>System.out.println()</code> is called.
*/
public class LaunchLogger {
private final static String logPrefix = "[jkf_launcher]:";
/**
* Contains the debug level.
*/
private static LogLevel level = LogLevel.INFO;
/**
* Set the log level.
*
* @param level the log level
*/
public static void setLogLevel(LogLevel level) {
LaunchLogger.level = level;
System.out.println(LaunchLogger.class.getName() +
": LogLevel set to: " + level);
}
/**
* Log error message.
*
* @param msg error message
*/
public static void error(String msg) {
if (LogLevel.isErrorLoggingEnabled(level)) {
System.out.println(logPrefix + " " + LogLevel.ERROR + ": "+ msg);
}
}
/**
* Log info messages.
*
* @param msg info message
*/
public static void info(String msg) {
if (LogLevel.isInfoLoggingEnabled(level)) {
System.out.println(logPrefix + " " + LogLevel.INFO + ": " + msg);
}
}
/**
* Log debug message.
*
* @param msg debug message
*/
public static void debug(String msg) {
if (LogLevel.isDebugLoggingEnabled(level)) {
System.out.println(logPrefix + " " + LogLevel.DEBUG + ": " + msg);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -