public class LogBuffer
extends java.util.logging.Handler
| Modifier and Type | Field and Description |
|---|---|
static int |
LIMIT
The maximum number of LogRecords stored in the buffer.
|
| Constructor and Description |
|---|
LogBuffer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(java.util.logging.Handler handler)
Add a Handler to the LogBuffer for LogRecord consuming.
|
static void |
addHandler(java.util.logging.Logger logger,
java.util.logging.Handler handler)
Add a Handler to a LogBuffer for LogRecord consuming.
|
static void |
addHandler(Log log,
java.util.logging.Handler handler)
Add a Handler to a LogBuffer for LogRecord consuming.
|
void |
close() |
void |
flush() |
static void |
flush(Log log)
Perform a flush operation on a LogBuffer.
|
static void |
flush(java.util.logging.Logger logger)
Perform a flush operation on a LogBuffer.
|
static LogBuffer |
get(Log log)
|
static LogBuffer |
get(java.util.logging.Logger logger)
Get the LogBuffer attached to the submitted Logger (if any).
|
void |
publish(java.util.logging.LogRecord record) |
void |
removeHandler(java.util.logging.Handler handler)
Remove a previously added Handler from the LogBuffer.
|
static void |
removeHandler(java.util.logging.Logger logger,
java.util.logging.Handler handler)
Remove a previously added Handler from a LogBuffer.
|
static void |
removeHandler(Log log,
java.util.logging.Handler handler)
Remove a previously added Handler from a LogBuffer.
|
public static final int LIMIT
If the limit is reached the oldest records are automatically discarded.
@Nullable public static LogBuffer get(java.util.logging.Logger logger)
public static void addHandler(Log log, java.util.logging.Handler handler)
If the submitted Log has no LogBuffer attached the call is ignored.
log - The Log identifying the LogBuffer to add to.handler - The Handler to add.get(Log),
addHandler(Handler)public static void addHandler(java.util.logging.Logger logger,
java.util.logging.Handler handler)
If the submitted Logger has no LogBuffer attached the call is ignored.
logger - The Logger identifying the LogBuffer to add to.handler - The Handler to add.get(Logger),
addHandler(Handler)public void addHandler(java.util.logging.Handler handler)
Any already buffered LogRecord is sent to the Handler during this operation.
handler - The Handler to add.public static void removeHandler(Log log, java.util.logging.Handler handler)
If the submitted Log has no LogBuffer attached the call is ignored.
log - The Log identifying the LogBuffer to remove from.handler - The Handler to remove.addHandler(Log, Handler),
get(Log),
removeHandler(Handler)public static void removeHandler(java.util.logging.Logger logger,
java.util.logging.Handler handler)
If the submitted Logger has no LogBuffer attached the call is ignored.
logger - The Logger identifying the LogBuffer to remove from.handler - The Handler to remove.addHandler(Logger, Handler),
get(Logger),
removeHandler(Handler)public void removeHandler(java.util.logging.Handler handler)
After removal the Handler will no longer receive any LogRecords.
handler - The Handler to remove.addHandler(Handler)public static void flush(Log log)
public static void flush(java.util.logging.Logger logger)
The flush request is forwarded to any currently registered Handler and any buffered LogRecord will be discarded. If the submitted Logger has no LogBuffer attached the call is ignored.
logger - The Logger identifying the LogBuffer to flush.get(Logger)public void publish(@Nullable java.util.logging.LogRecord record)
publish in class java.util.logging.Handlerpublic void flush()
flush in class java.util.logging.Handlerpublic void close()
close in class java.util.logging.Handler