public class Log
extends java.lang.Object
Constructor and Description |
---|
Log(long handle)
Constructor storing the pointer/address to the underlying native object
|
Modifier and Type | Method and Description |
---|---|
java.util.List<LoggingFacility> |
activeFacilities()
Gets the list with all enabled logging facilities
Debug log entries will be added only from the listed facilities.
|
void |
activeFacilities(java.util.List<LoggingFacility> value)
Configures the list with all enabled logging facilities
Debug log entries will be added only from the listed facilities.
|
protected void |
finalize()
Ensures the underlying native object destruction
|
long |
handle()
Gets the pointer/address to the underlying native object
|
Result |
logClose()
Stops logging
Closes the current log file, if open.
|
void |
logMessage(LoggingLevel level,
LoggingFacility facility,
java.lang.String facilityName,
java.lang.String sourceFileName,
int sourceLine,
java.lang.String message)
Log a message
Adds a log entry to the log.
|
Result |
logOpen(java.lang.String fileName,
java.lang.String oldFileName,
LoggingLevel maxLevel,
long maxSizeBytes)
Starts logging
Starts the log facility.
|
boolean |
shouldLogFacility(LoggingFacility value)
Checks whether the given logging facility is enabled
|
public Log(long handle)
handle
- Pointer/address to the underlying native objectpublic long handle()
protected void finalize()
finalize
in class java.lang.Object
public java.util.List<LoggingFacility> activeFacilities()
LoggingFacility
public void activeFacilities(java.util.List<LoggingFacility> value)
value
- The list with all active logging facilitiesLoggingFacility
public Result logOpen(java.lang.String fileName, java.lang.String oldFileName, LoggingLevel maxLevel, long maxSizeBytes)
fileName
- Main log file nameoldFileName
- Secondary log file. Only used if "maxSizeBytes" is greater than 0.maxLevel
- Maximum level to log. Messages with higher level values, meaning lower severity are
automatically dropped before filtering.maxSizeBytes
- Maximum size for a single log file. Affects both the main and the secondary file,
resulting in maximum twice as much space used.Result
public void logMessage(LoggingLevel level, LoggingFacility facility, java.lang.String facilityName, java.lang.String sourceFileName, int sourceLine, java.lang.String message)
level
- Log level. If it is higher than the current configured maximum log level the message will be ignored.facility
- Short subsystem name in the form of TAG or TAG:SUBTAGfacilityName
- String representation of the subsystemsourceFileName
- Source file namesourceLine
- Source file linemessage
- The log message itselfLoggingFacility logOpen
public Result logClose()
Result
public boolean shouldLogFacility(LoggingFacility value)
value
- The logging facility to be checkedLoggingFacility