public class UnitComponent extends Unit implements LoggerSimple
Unit
and exposes the logging methods. See Unit
for details. It implements LoggerSimple
.
This allows a class to use the functionality of a Unit
without extending Unit
.
net.xqhs.util.config.Config.ConfigLockedException
LoggerSimple.Level
DEFAULT_LEVEL, DEFAULT_UNIT_NAME, display, ensureNew, level, linkData, log, loggerWrapperClass, loggerWrapperType, logName, reporter, unitName
ARGUMENT_BEGIN, ARGUMENT_END, ARGUMENT_PLACEHOLDER
Constructor and Description |
---|
UnitComponent() |
Modifier and Type | Method and Description |
---|---|
void |
dbg(Debug.DebugItem debug,
java.lang.String message,
java.lang.Object... arguments)
This method displays a log message (with the level
TRACE ) only if the specified Debug.DebugItem is
activated. |
void |
doExit()
Instructs the Unit to exit.
|
java.lang.String |
getUnitName()
This method is only accessible inside the instance, except if for good reasons an extending class makes it
public.
|
void |
le(java.lang.String message,
java.lang.Object... arguments)
Post an error message.
|
void |
lf(java.lang.String message,
java.lang.Object... arguments)
Post a tracing message.
|
void |
li(java.lang.String message,
java.lang.Object... arguments)
Post an informative message.
|
java.lang.Object |
lr(java.lang.Object ret)
This method should be used in return statements.
|
java.lang.Object |
lr(java.lang.Object ret,
java.lang.String message,
java.lang.Object... arguments)
This method should be used in return statements.
|
void |
lw(java.lang.String message,
java.lang.Object... arguments)
Post a warning message.
|
compose, getDefaultUnitName, l, lock, lockedR, setLink, setLink, setLogDisplay, setLogEnsureNew, setLoggerClass, setLoggerType, setLoggerTypeClass, setLogLevel, setLogReporter, setUnitName, setUnitName
public void le(java.lang.String message, java.lang.Object... arguments)
Unit
LoggerSimple
.le
in interface LoggerSimple
le
in class Unit
message
- : the message to displayarguments
- : arguments to insert into the message. See LoggerSimple
.public void lw(java.lang.String message, java.lang.Object... arguments)
Unit
LoggerSimple
.lw
in interface LoggerSimple
lw
in class Unit
message
- : the message to displayarguments
- : arguments to insert into the message. See LoggerSimple
.public void li(java.lang.String message, java.lang.Object... arguments)
Unit
LoggerSimple
.li
in interface LoggerSimple
li
in class Unit
message
- : the message to displayarguments
- : arguments to insert into the message. See LoggerSimple
.public void lf(java.lang.String message, java.lang.Object... arguments)
Unit
LoggerSimple
.lf
in interface LoggerSimple
lf
in class Unit
message
- : the message to displayarguments
- : arguments to insert into the message. See LoggerSimple
.public java.lang.Object lr(java.lang.Object ret)
Unit
Object
in the argument, displaying the Object
. See LoggerSimple
.lr
in interface LoggerSimple
lr
in class Unit
ret
- : the Object
to return.Object
passed as argument.public java.lang.Object lr(java.lang.Object ret, java.lang.String message, java.lang.Object... arguments)
Unit
Object
in the argument. See LoggerSimple
.
The Object
in the argument is also put in the log message.
lr
in interface LoggerSimple
lr
in class Unit
ret
- : the Object
to return and to display.message
- : the message to display beside the Object
.arguments
- : arguments to insert into the message. See LoggerSimple
.Object
passed as argument.public void dbg(Debug.DebugItem debug, java.lang.String message, java.lang.Object... arguments)
Unit
TRACE
) only if the specified Debug.DebugItem
is
activated. See LoggerSimple
.dbg
in interface LoggerSimple
dbg
in class Unit
debug
- : the Debug.DebugItem
message
- : the log messagearguments
- : arguments to insert into the message. See LoggerSimple
.public void doExit()
Unit
As the Unit layer only manages logging, the only thing that happens is that the log exits (if any).
public java.lang.String getUnitName()
Unit
getUnitName
in class Unit
Unit
name, as given to or set in the constructor.