LuciadCPillar C# 2024.1.09
Luciad.ILoggingBackend Interface Reference

Backend for the logging in this library. More...

Public Member Functions

void DeleteLogger (object handle)
 Indicates that the logger with the given handle is not used anymore. More...
 
bool IsEnabled (object handle, LogLevel level)
 Returns whether logging output is enabled for the specified logger at the given level. More...
 
void Log (object handle, LogLevel level, string message)
 This function will not be called if level is not enabled for logger. More...
 
void Log (object handle, LogLevel level, string message, System.Exception exception)
 This function will not be called if level is not enabled for logger. More...
 
object NewLogger (string name)
 Creates a new handle for a logger with the given name. More...
 

Detailed Description

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.

Member Function Documentation

◆ DeleteLogger()

void Luciad.ILoggingBackend.DeleteLogger ( object  handle)

Indicates that the logger with the given handle is not used anymore.

Implementations could delete the corresponding resource, if any.

Parameters
handlea handle previously returned by newLogger(std.string)

◆ IsEnabled()

bool Luciad.ILoggingBackend.IsEnabled ( object  handle,
LogLevel  level 
)

Returns whether logging output is enabled for the specified logger at the given level.

Parameters
handleidentifies a logger
levela specific logging level
Returns
whether logging output is enabled for the specified logger at the given level

◆ Log() [1/2]

void Luciad.ILoggingBackend.Log ( object  handle,
LogLevel  level,
string  message 
)

This function will not be called if level is not enabled for logger.

Parameters
handleidentifies a logger
levela specific logging level
messagethe message to log
See also
isEnabled()

◆ Log() [2/2]

void Luciad.ILoggingBackend.Log ( object  handle,
LogLevel  level,
string  message,
System.Exception  exception 
)

This function will not be called if level is not enabled for logger.

Parameters
handleidentifies a logger
levela specific logging level
messagethe message to log
exceptionthe exception associated with the message
See also
isEnabled()

◆ NewLogger()

object Luciad.ILoggingBackend.NewLogger ( string  name)

Creates a new handle for a logger with the given 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 deleted , this function will be not be called again with that same name.

Parameters
namethe name of the logger that is requested
Returns
a handle for the new logger