public class ThreadLogUtil extends Object
Prints thread information and lock-specific info.
Modifier and Type | Field and Description |
---|---|
static boolean |
ENABLED_INFO
Enable info logging.
|
static boolean |
ENABLED_TRACE
Enable trace logging.
|
static int |
info
Set info log level.
|
static int |
trace
Set trace log level.
|
Constructor and Description |
---|
ThreadLogUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
info(String text,
Object... objects)
If enabled, logs for info level the given objects and text
|
static void |
trace(String text,
Object... objects)
If enabled, logs for trace level the given objects and text
|
static void |
traceLock(String lockAction,
ReentrantLock lock)
Logs the lock and action.
|
static void |
traceLock(String lockAction,
ReentrantReadWriteLock lock)
Logs the lock and action.
|
public static int trace
public static int info
public static final boolean ENABLED_TRACE
public static final boolean ENABLED_INFO
public static void trace(String text, Object... objects)
text
- to logobjects
- to writepublic static void info(String text, Object... objects)
text
- to logobjects
- to writepublic static void traceLock(String lockAction, ReentrantLock lock)
lockAction
- is the action towards the locklock
- is the lock instancepublic static void traceLock(String lockAction, ReentrantReadWriteLock lock)
lockAction
- is the action towards the locklock
- is the lock instance