public class Log extends Object
┌─┐ ┌─┐
┌──┘ ┴───────┘ ┴──┐
│ │
│ ─── │
│ ─┬┘ └┬─ │
│ │
│ ─┴─ │
│ │
└───┐ ┌───┘
│ │
│ │
│ │
│ └──────────────┐
│ │
│ ├─┐
│ author:lelouch ┌─┘
│ │
└─┐ ┐ ┌───────┬──┐ ┌──┘
│ ─┤ ─┤ │ ─┤ ─┤
└──┴──┘ └──┴──┘
神兽保佑
代码无BUG!
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Log.LogLevel
日志等级
|
| 限定符和类型 | 字段和说明 |
|---|---|
static Log.LogLevel |
logLevel |
| 构造器和说明 |
|---|
Log(Class<?> clazz) |
Log(Class<?> clazz,
boolean realClass) |
Log(Class<?> clazz,
boolean realClass,
boolean realMethod) |
Log(Class<?> clazz,
String name) |
Log(Class<?> clazz,
String name,
boolean realClass) |
Log(Class<?> clazz,
String name,
boolean realClass,
boolean realMethod) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
debug(String msg)
Log a message at the DEBUG level.
|
void |
debug(String format,
Object... arg)
debug 等级日志,小于 info
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!! |
static Log |
equilibriumLog(Class<?> clazz)
均衡模式
|
void |
error(String msg)
Log a message at the ERROR level.
|
void |
error(String format,
Object... arg)
error 等级日志,
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!! |
void |
error(String msg,
Throwable t)
Log a message at the ERROR level.
|
Class<?> |
getClazz() |
Log.LogLevel |
getLogLevel() |
String |
getLogName() |
void |
info(String msg)
Log a message at the INFO level.
|
void |
info(String format,
Object... arg)
info 等级日志,小于 warm
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!! |
static Log |
performanceLog(Class<?> clazz)
性能模式
|
static void |
setLogLevel(Log.LogLevel logLevel) |
void |
trace(String msg)
Log a message at the TRACE level.
|
void |
trace(String format,
Object... arg)
Trace 等级日志,小于 debug
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!! |
void |
warn(String msg)
Log a message at the WARN level.
|
void |
warn(String format,
Object... arg)
warn 等级日志,小于 error
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!! |
public static Log.LogLevel logLevel
public Log(Class<?> clazz)
public Log(Class<?> clazz, boolean realClass)
public Log(Class<?> clazz, boolean realClass, boolean realMethod)
public void trace(String msg)
msg - the message string to be loggedpublic void trace(String format, Object... arg)
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!!
format - 格式文本,{} 代表变量arg - 变量对应的参数public void debug(String msg)
msg - the message string to be loggedpublic void debug(String format, Object... arg)
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!!
format - 格式文本,{} 代表变量arg - 变量对应的参数public void info(String msg)
msg - the message string to be loggedpublic void info(String format, Object... arg)
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!!
format - 格式文本,{} 代表变量arg - 变量对应的参数public void warn(String msg)
msg - the message string to be loggedpublic void warn(String format, Object... arg)
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!!
format - 格式文本,{} 代表变量arg - 变量对应的参数public void error(String msg)
msg - the message string to be loggedpublic void error(String format, Object... arg)
由于动态获取Logger,效率较低,建议在非频繁调用的情况下使用!!
format - 格式文本,{} 代表变量arg - 变量对应的参数public void error(String msg, Throwable t)
msg - the message string to be loggedpublic Class<?> getClazz()
public String getLogName()
public Log.LogLevel getLogLevel()
public static void setLogLevel(Log.LogLevel logLevel)
Copyright © 2020. All rights reserved.