public class Log extends Object
private final Log _log = context.logManager().getLog(MyClassName.class);
If there is anything in here that doesn't make sense, turn off your computer and go fly a kite.| Modifier and Type | Field and Description |
|---|---|
static int | CRITCRIT. |
static int | DEBUGDEBUG. |
static int | ERRORERROR. |
static int | INFOINFO. |
static String | STR_CRITSTR_CRIT. |
static String | STR_DEBUGSTR_DEBUG. |
static String | STR_ERRORSTR_ERROR. |
static String | STR_INFOSTR_INFO. |
static String | STR_WARNSTR_WARN. |
static int | WARNWARN. |
| Constructor and Description |
|---|
Log(Class<?> cls)Warning - not recommended. |
Log(LogManager manager,
Class<?> cls)Log |
Log(LogManager manager,
Class<?> cls,
String name)Log |
Log(LogManager manager,
String name)Log |
Log(String name)Warning - not recommended. |
| Modifier and Type | Method and Description |
|---|---|
void | debug(String msg)Log a debug message. |
void | debug(String msg,
Throwable t)Log a debug message with a throwable. |
void | error(String msg)Log an error message. |
void | error(String msg,
Throwable t)Log an error message with a throwable. |
static int | getLevel(String level)Get the log level integer for a string level name. |
int | getMinimumPriority()Get the minimum priority for logging. |
String | getName()Get the logger name. |
Object | getScope()Returns the LogScope (private class). |
(package private) static String | getScope(String name,
Class<?> cls)Get the scope string for a name and class. |
void | info(String msg)Log an info message. |
void | info(String msg,
Throwable t)Log an info message with a throwable. |
void | log(int priority,
String msg)Log a message at the given priority. |
void | log(int priority,
String msg,
Throwable t)Log a message with a throwable at the given priority. |
void | logAlways(int priority,
String msg)Always log this message with the given priority, ignoring current minimum priority level. |
void | logCloseLoop(int level,
Object... desc)Logs a close loop when closing a resource
This method is for debugging purposes only and
is subject to change or removal w/o notice. |
void | logCloseLoop(Object... desc)logs a loop when closing a resource with level DEBUG
This method is for debugging purposes only and
is subject to change or removal w/o notice. |
void | setMinimumPriority(int priority)Set the minimum priority for logging. |
boolean | shouldDebug()Check if DEBUG level logging is enabled. |
boolean | shouldError()Check if ERROR level logging is enabled. |
boolean | shouldInfo()Check if INFO level logging is enabled. |
boolean | shouldLog(int priority)Check if messages at the given priority should be logged. |
boolean | shouldWarn()Check if WARN level logging is enabled. |
static String | toLevelString(int level)Convert a log level integer to its string representation. |
void | warn(String msg)Log a warning message. |
void | warn(String msg,
Throwable t)Log a warning message with a throwable. |
public static final int CRIT
public static final int DEBUG
public static final int ERROR
public static final int INFO
public static final String STR_CRIT
public static final String STR_DEBUG
public static final String STR_ERROR
public static final String STR_INFO
public static final String STR_WARN
public static final int WARN
public Log(Class<?> cls)
Log(LogManager manager, Class<?> cls)
Log(LogManager manager, Class<?> cls, String name)
Log(LogManager manager, String name)
public Log(String name)
public void debug(String msg)
msg - the messagepublic void debug(String msg, Throwable t)
msg - the messaget - the throwablepublic void error(String msg)
msg - the messagepublic void error(String msg, Throwable t)
msg - the messaget - the throwablepublic static int getLevel(String level)
level - the levelpublic int getMinimumPriority()
public String getName()
public Object getScope()
static String getScope(String name, Class<?> cls)
name - the logger namecls - the classpublic void info(String msg)
msg - the messagepublic void info(String msg, Throwable t)
msg - the messaget - the throwablepublic void log(int priority,
String msg)priority - the priority levelmsg - the messagepublic void log(int priority,
String msg,
Throwable t)priority - the priority levelmsg - the messaget - the throwablepublic void logAlways(int priority,
String msg)public void logCloseLoop(int level,
Object... desc)desc - vararg description of the resourcelevel - level at which to logpublic void logCloseLoop(Object... desc)
desc - vararg descriptionpublic void setMinimumPriority(int priority)
priority - the minimum prioritypublic boolean shouldDebug()
public boolean shouldError()
public boolean shouldInfo()
public boolean shouldLog(int priority)
priority - the priority levelpublic boolean shouldWarn()
public static String toLevelString(int level)
level - the integer levelpublic void warn(String msg)
msg - the message