public class Log extends Object
debug(String),
debug(String, Throwable),
warn(String),
warn(String, Throwable),
error(String),
error(String, Throwable)| 限定符和类型 | 类和说明 |
|---|---|
static class |
Log.Config
日志配置
|
static class |
Log.Level
日志级别
|
| 构造器和说明 |
|---|
Log() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
debug(String msg) |
static void |
debug(String msg,
Throwable t) |
static void |
error(String msg) |
static void |
error(String msg,
Throwable t) |
private static String |
getCaller()
获取调用方的信息
|
private static String |
getDate()
获取格式化后的日期
|
private static void |
print(Log.Level level,
String msg,
Throwable t,
PrintStream ps)
打印日志内容,格式:2019-08-02 20:44:07 main me.zhyd.oauth.log.Log(debug:39) [DEBUG] - xxxx
|
static void |
warn(String msg) |
static void |
warn(String msg,
Throwable t) |
private static void |
writeThrowable(Throwable t,
PrintStream targetStream)
打印异常信息
|
public static void debug(String msg)
public static void warn(String msg)
public static void error(String msg)
private static void print(Log.Level level, String msg, Throwable t, PrintStream ps)
level - 日志级别msg - 日志内容t - 异常信息ps - 实际执行打印的PrintStreamprivate static String getCaller()
private static String getDate()
private static void writeThrowable(Throwable t, PrintStream targetStream)
t - 异常targetStream - 实际执行打印的PrintStreamCopyright © 2023. All rights reserved.