
public class Logger extends Object
C++ wrapper to SLF4J Java Logging frame work.
If not running inside a JVM, then this class
just does a rudimentary printout of log messages
to stderr.
Otherwise, it forwards to Java's SLF4J logging framework.
| Modifier and Type | Class and Description |
|---|---|
static class |
Logger.Level
Different logging levels (noiseness) supported by us.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
debug(String filename,
int lineNo,
String format) |
void |
delete()
Releases any underlying native memory and marks this object
as invalid.
|
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
boolean |
error(String filename,
int lineNo,
String format) |
static Logger |
getLogger(String aLoggerName)
Returns a new Logger object for this loggerName.
|
String |
getName() |
static Logger |
getStaticLogger(String aLoggerName)
Get a Logger object, but ask the Logger code to
free it up once the JavaVM shuts down. |
int |
hashCode()
Get a hashable value for this object.
|
boolean |
info(String filename,
int lineNo,
String format) |
static boolean |
isGlobalLogging(Logger.Level level) |
boolean |
isLogging(Logger.Level level) |
boolean |
isPrintStackTrace() |
boolean |
log(String filename,
int lineNo,
Logger.Level level,
String format)
Log the message to the logger, using sprintf() format
strings. |
static void |
setGlobalIsLogging(Logger.Level level,
boolean value) |
void |
setIsLogging(Logger.Level level,
boolean value) |
void |
setPrintStackTrace(boolean value) |
boolean |
trace(String filename,
int lineNo,
String format) |
boolean |
warn(String filename,
int lineNo,
String format) |
public boolean equals(Object obj)
public int hashCode()
public void delete()
Normally Ferry manages when to release native memory.
In the unlikely event you want to control EXACTLY when a native
object is released, each Humble object has a delete()
method that you can use. Once you call delete(),
you must ENSURE your object is never referenced again from
that Java object -- Ferry tries to help you avoid crashes if you
accidentally use an object after deletion but on this but we
cannot offer 100% protection (specifically if another thread
is accessing that object EXACTLY when you delete() it).
public static Logger getLogger(String aLoggerName)
aLoggerName - A name (no spaces allowed) for this logger.public static Logger getStaticLogger(String aLoggerName)
aLoggerName - A name (no spaces allowed) for this logger.public boolean log(String filename, int lineNo, Logger.Level level, String format)
filename - The filename that is logging, or NULL.lineNo - The line number where this log statement is executed from.level - Level to log at.format - A format specification string, in sprintf format.public boolean isPrintStackTrace()
public void setPrintStackTrace(boolean value)
public boolean isLogging(Logger.Level level)
public void setIsLogging(Logger.Level level, boolean value)
public static boolean isGlobalLogging(Logger.Level level)
public static void setGlobalIsLogging(Logger.Level level, boolean value)
public String getName()
Copyright © 2018 Humble Software. All rights reserved.