Package com.luciad
Interface ILoggingBackend
public interface ILoggingBackend
Backend for the logging in this library.
Users can implement this backend to delegate the internal logging to their framework of choice. The implementation must then be configured during global initialization in order to be used by this library.
Implementations must be thread-safe. All methods will be called concurrently from various threads.
Note that the only purpose of this interface is to facilitate redirecting the logging performed by this library. We expect that, in your own code, you use your framework of choice directly.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteLogger(Object handle) Indicates that the logger with the given handle is not used anymore.booleanReturns whether logging output is enabled for the specified logger at the given level.voidThis function will not be called if \a level is not enabled for \a logger.voidThis function will not be called if \a level is not enabled for \a logger.Creates a new handle for a logger with the given \a name.
-
Method Details
-
newLogger
Creates a new handle for a logger with the given \a name. At any time, at most one Handle is requested for a given name. This means that, unless a previously returned handle for a name is \link deleteLogger deleted \endlink, this function will be not be called again with that same name.- Parameters:
name- the name of the logger that is requested- Returns:
- a handle for the new logger
-
isEnabled
Returns whether logging output is enabled for the specified logger at the given level.- Parameters:
handle- identifies a loggerlevel- a specific logging level- Returns:
- whether logging output is enabled for the specified logger at the given level
-
log
This function will not be called if \a level is not enabled for \a logger.- Parameters:
handle- identifies a loggerlevel- a specific logging levelmessage- the message to log
-
log
void log(@Nullable Object handle, @NotNull LogLevel level, @NotNull String message, @NotNull Throwable exception) This function will not be called if \a level is not enabled for \a logger.- Parameters:
handle- identifies a loggerlevel- a specific logging levelmessage- the message to logexception- the exception associated with the message
-
deleteLogger
Indicates that the logger with the given handle is not used anymore. Implementations could delete the corresponding resource, if any.- Parameters:
handle- a handle previously returned by newLogger(std::string)
-