public interface Logger
Modifier and Type | Method and Description |
---|---|
int |
getNextUniqueSessionId()
Returns a unique id that can be used to track logs and traffic data of one session.
|
boolean |
isEnabled()
Indicates whether logging is enabled or not.
|
void |
log(String function,
String message)
Writes a log entry.
|
void |
log(String function,
String message,
Exception exception)
Writes a log entry with exception trace.
|
void |
logTraffic(int sessionId,
boolean isRead,
byte[] buffer,
int offset,
int count)
Logs a read or write operation.
|
void |
setEnabled(boolean enabled)
Enables or disables logging.
|
boolean isEnabled()
true
if logging is enabled, otherwise false
.void setEnabled(boolean enabled)
enabled
- true
to enable logging, false
otherwise.int getNextUniqueSessionId()
DataManSystem
object when a connection is being
established.void log(String function, String message)
function
- Name of the function for which the log entry is created.message
- The log message.void log(String function, String message, Exception exception)
function
- Name of the function for which the log entry is created.message
- The log message.exception
- The exception object to tracevoid logTraffic(int sessionId, boolean isRead, byte[] buffer, int offset, int count)
sessionId
- The unique id of the session to which this log belong.isRead
- true
in case of a read operation, false
in case of a write operation.buffer
- Buffer that contains the bytes that were read/written.offset
- Offset in the buffer to log from.count
- Number of bytes to write to the log from the buffer.