public class LogLevel
extends java.lang.Object
Usually when we log a message, we also specify the log level explicitly or implicitly,
so if we setup a log level using XLog.init(...), all the logs which is with
a log level smaller than the setup one would not be printed.
The priority of log levels is: VERBOSE < DEBUG < INFO <
WARN < ERROR.
And there are two special log levels which are usually used for Log#init:
NONE and ALL, NONE for not printing any log and ALL for
printing all logs.
| Modifier and Type | Field and Description |
|---|---|
static int |
ALL
Log level for XLog#init, printing all logs.
|
static int |
DEBUG
Log level for XLog.d.
|
static int |
ERROR
Log level for XLog.e.
|
static int |
INFO
Log level for XLog.i.
|
static int |
NONE
Log level for XLog#init, printing no log.
|
static int |
VERBOSE
Log level for XLog.v.
|
static int |
WARN
Log level for XLog.w.
|
| Constructor and Description |
|---|
LogLevel() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getLevelName(int logLevel)
Get a name representing the specified log level.
|
static java.lang.String |
getShortLevelName(int logLevel)
Get a short name representing the specified log level.
|
public static final int VERBOSE
public static final int DEBUG
public static final int INFO
public static final int WARN
public static final int ERROR
public static final int ALL
public static final int NONE
public static java.lang.String getLevelName(int logLevel)
The returned name may be
Level less than VERBOSE: "VERBOSE-N", N means levels below
VERBOSE
VERBOSE: "VERBOSE"
DEBUG: "DEBUG"
INFO: "INFO"
WARN: "WARN"
ERROR: "ERROR"
Level greater than ERROR: "ERROR+N", N means levels above
ERROR
logLevel - the log level to get name forpublic static java.lang.String getShortLevelName(int logLevel)
The returned name may be
Level less than VERBOSE: "V-N", N means levels below
VERBOSE
VERBOSE: "V"
DEBUG: "D"
INFO: "I"
WARN: "W"
ERROR: "E"
Level greater than ERROR: "E+N", N means levels above
ERROR
logLevel - the log level to get short name for