📄 log.java
字号:
package com.liuwan.log;
/**
* <p>Title: Develop game research</p>
*
* <p>Description: Develop game research</p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: Liuwan studio</p>
*
* @author Liuwan
* @version 1.0
*/
import java.util.Date;
public class Log {
public Log() {
}
/**
* 捕捉错误,输出错误系统日志
* @param s 错误描述
* @param throwable 捕捉到的异常类
*/
public static void error(String s, Throwable throwable) {
System.out.println(new Date(System.currentTimeMillis()).toString() + " [ " + s + " ] " + throwable);
}
/**
* 捕捉错误,输出错误系统日志
* @param throwable
*/
public static void error(Throwable throwable) {
System.out.println("Error: "+new Date(System.currentTimeMillis()).toString() + " [ " + throwable +" ]");
}
public static void error(String errorMsg) {
System.out.println("Error: "+new Date(System.currentTimeMillis()).toString() + " [ " + errorMsg + " ]");
}
public static void error(String className, String methodName,
String errorMsg) {
System.out.println("Error: " +
new Date(System.currentTimeMillis()).toString() +
" class: " + className + " methodName: " +
methodName + " [ " + errorMsg + " ]");
}
public static void message(String msg) {
System.out.println("Message: " + " [ " + msg + " ]");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -