public class Logger extends MadaraJNI
Constructor and Description |
---|
Logger()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addFile(java.lang.String filename)
Adds a file to logging outputs
|
void |
addSyslog()
Adds the system logger to logging outputs
|
void |
addTerm()
Adds the terminal to logging outputs (turned on by default)
|
void |
clear()
Clears all logging targets
|
protected void |
finalize()
Cleans up underlying C resources
|
void |
free()
Deletes the C instantiation.
|
static Logger |
fromPointer(long cptr)
Creates a java object instance from a C/C++ pointer
|
static Logger |
fromPointer(long cptr,
boolean shouldManage)
Creates a java object instance from a C/C++ pointer
|
int |
getLevel()
Gets the logging level, e.g., where 0 is EMERGENCY and 6 is DETAILED
|
java.lang.String |
getTag()
Gets the tag used in system logging
|
void |
log(int level,
java.lang.String message)
Logs a message at the specified level
|
void |
setLevel(int level)
Sets the logging level
|
void |
setTag(java.lang.String tag)
Sets the tag used for system logging
|
void |
setTimestampFormat(java.lang.String format)
Sets timestamp format.
|
public static Logger fromPointer(long cptr)
cptr
- C pointer to the objectpublic static Logger fromPointer(long cptr, boolean shouldManage)
cptr
- C pointer to the objectshouldManage
- if true, manage the pointerpublic java.lang.String getTag()
public int getLevel()
public void setTag(java.lang.String tag)
tag
- the tag to be used for system loggingpublic void setLevel(int level)
level
- level of message severity to print to log targetspublic void clear()
public void addTerm()
public void addSyslog()
public void addFile(java.lang.String filename)
filename
- the name of a file to add to logging targetspublic void log(int level, java.lang.String message)
level
- the logging severity level (0 is high)message
- the message to send to all logging targetspublic void setTimestampFormat(java.lang.String format)
format
- the format of the timestamp. See C++
strftime definition for common usage.public void free()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- necessary for override but unused