public class Logger
extends java.lang.Object
A Logger is always generated and mostly accessed by XLog, but for customization
purpose, you can configure a Logger via the Logger.Builder which is returned by
XLog when you trying to start a customization using XLog.tag(String)
or other configuration method, and to use the customized Logger, you should call
the Logger.Builder.build() to build a Logger, and then you can log using
the Logger assuming that you are using the XLog directly.
| Modifier and Type | Class and Description |
|---|---|
static class |
Logger.Builder
Builder for
Logger. |
| Modifier and Type | Method and Description |
|---|---|
void |
d(java.lang.Object object)
Log an object with level
LogLevel.DEBUG. |
void |
d(java.lang.Object[] array)
Log an array with level
LogLevel.DEBUG. |
void |
d(java.lang.String msg)
Log a message with level
LogLevel.DEBUG. |
void |
d(java.lang.String format,
java.lang.Object... args)
Log a message with level
LogLevel.DEBUG. |
void |
d(java.lang.String msg,
java.lang.Throwable tr)
Log a message and a throwable with level
LogLevel.DEBUG. |
void |
e(java.lang.Object object)
Log an object with level
LogLevel.ERROR. |
void |
e(java.lang.Object[] array)
Log an array with level
LogLevel.ERROR. |
void |
e(java.lang.String msg)
Log a message with level
LogLevel.ERROR. |
void |
e(java.lang.String format,
java.lang.Object... args)
Log a message with level
LogLevel.ERROR. |
void |
e(java.lang.String msg,
java.lang.Throwable tr)
Log a message and a throwable with level
LogLevel.ERROR. |
void |
i(java.lang.Object object)
Log an object with level
LogLevel.INFO. |
void |
i(java.lang.Object[] array)
Log an array with level
LogLevel.INFO. |
void |
i(java.lang.String msg)
Log a message with level
LogLevel.INFO. |
void |
i(java.lang.String format,
java.lang.Object... args)
Log a message with level
LogLevel.INFO. |
void |
i(java.lang.String msg,
java.lang.Throwable tr)
Log a message and a throwable with level
LogLevel.INFO. |
void |
json(java.lang.String json)
Log a JSON string, with level
LogLevel.DEBUG by default. |
void |
log(int logLevel,
java.lang.Object object)
Log an object with specific log level.
|
void |
log(int logLevel,
java.lang.Object[] array)
Log an array with specific log level.
|
void |
log(int logLevel,
java.lang.String msg)
Log a message with specific log level.
|
void |
log(int logLevel,
java.lang.String format,
java.lang.Object... args)
Log a message with specific log level.
|
void |
log(int logLevel,
java.lang.String msg,
java.lang.Throwable tr)
Log a message and a throwable with specific log level.
|
void |
v(java.lang.Object object)
Log an object with level
LogLevel.VERBOSE. |
void |
v(java.lang.Object[] array)
Log an array with level
LogLevel.VERBOSE. |
void |
v(java.lang.String msg)
Log a message with level
LogLevel.VERBOSE. |
void |
v(java.lang.String format,
java.lang.Object... args)
Log a message with level
LogLevel.VERBOSE. |
void |
v(java.lang.String msg,
java.lang.Throwable tr)
Log a message and a throwable with level
LogLevel.VERBOSE. |
void |
w(java.lang.Object object)
Log an object with level
LogLevel.WARN. |
void |
w(java.lang.Object[] array)
Log an array with level
LogLevel.WARN. |
void |
w(java.lang.String msg)
Log a message with level
LogLevel.WARN. |
void |
w(java.lang.String format,
java.lang.Object... args)
Log a message with level
LogLevel.WARN. |
void |
w(java.lang.String msg,
java.lang.Throwable tr)
Log a message and a throwable with level
LogLevel.WARN. |
void |
xml(java.lang.String xml)
Log a XML string, with level
LogLevel.DEBUG by default. |
public void v(java.lang.Object object)
LogLevel.VERBOSE.object - the object to logLogger.Builder.addObjectFormatter(Class, ObjectFormatter)public void v(java.lang.Object[] array)
LogLevel.VERBOSE.array - the array to logpublic void v(java.lang.String format,
java.lang.Object... args)
LogLevel.VERBOSE.format - the format of the message to logargs - the arguments of the message to logpublic void v(java.lang.String msg)
LogLevel.VERBOSE.msg - the message to logpublic void v(java.lang.String msg,
java.lang.Throwable tr)
LogLevel.VERBOSE.msg - the message to logtr - the throwable to be logpublic void d(java.lang.Object object)
LogLevel.DEBUG.object - the object to logLogger.Builder.addObjectFormatter(Class, ObjectFormatter)public void d(java.lang.Object[] array)
LogLevel.DEBUG.array - the array to logpublic void d(java.lang.String format,
java.lang.Object... args)
LogLevel.DEBUG.format - the format of the message to log, null if just need to concat argumentsargs - the arguments of the message to logpublic void d(java.lang.String msg)
LogLevel.DEBUG.msg - the message to logpublic void d(java.lang.String msg,
java.lang.Throwable tr)
LogLevel.DEBUG.msg - the message to logtr - the throwable to be logpublic void i(java.lang.Object object)
LogLevel.INFO.object - the object to logLogger.Builder.addObjectFormatter(Class, ObjectFormatter)public void i(java.lang.Object[] array)
LogLevel.INFO.array - the array to logpublic void i(java.lang.String format,
java.lang.Object... args)
LogLevel.INFO.format - the format of the message to log, null if just need to concat argumentsargs - the arguments of the message to logpublic void i(java.lang.String msg)
LogLevel.INFO.msg - the message to logpublic void i(java.lang.String msg,
java.lang.Throwable tr)
LogLevel.INFO.msg - the message to logtr - the throwable to be logpublic void w(java.lang.Object object)
LogLevel.WARN.object - the object to logLogger.Builder.addObjectFormatter(Class, ObjectFormatter)public void w(java.lang.Object[] array)
LogLevel.WARN.array - the array to logpublic void w(java.lang.String format,
java.lang.Object... args)
LogLevel.WARN.format - the format of the message to log, null if just need to concat argumentsargs - the arguments of the message to logpublic void w(java.lang.String msg)
LogLevel.WARN.msg - the message to logpublic void w(java.lang.String msg,
java.lang.Throwable tr)
LogLevel.WARN.msg - the message to logtr - the throwable to be logpublic void e(java.lang.Object object)
LogLevel.ERROR.object - the object to logLogger.Builder.addObjectFormatter(Class, ObjectFormatter)public void e(java.lang.Object[] array)
LogLevel.ERROR.array - the array to logpublic void e(java.lang.String format,
java.lang.Object... args)
LogLevel.ERROR.format - the format of the message to log, null if just need to concat argumentsargs - the arguments of the message to logpublic void e(java.lang.String msg)
LogLevel.ERROR.msg - the message to logpublic void e(java.lang.String msg,
java.lang.Throwable tr)
LogLevel.ERROR.msg - the message to logtr - the throwable to be logpublic void log(int logLevel,
java.lang.Object object)
logLevel - the specific log levelobject - the object to logLogger.Builder.addObjectFormatter(Class, ObjectFormatter)public void log(int logLevel,
java.lang.Object[] array)
logLevel - the specific log levelarray - the array to logpublic void log(int logLevel,
java.lang.String format,
java.lang.Object... args)
logLevel - the specific log levelformat - the format of the message to log, null if just need to concat argumentsargs - the arguments of the message to logpublic void log(int logLevel,
java.lang.String msg)
logLevel - the specific log levelmsg - the message to logpublic void log(int logLevel,
java.lang.String msg,
java.lang.Throwable tr)
logLevel - the specific log levelmsg - the message to logtr - the throwable to be logpublic void json(java.lang.String json)
LogLevel.DEBUG by default.json - the JSON string to logpublic void xml(java.lang.String xml)
LogLevel.DEBUG by default.xml - the XML string to log