Logging#

Enumerations Summary#

OmniClientLogLevel

Log Level.

Functions Summary#

char omniClientGetLogLevelChar(OmniClientLogLevel level)

Retrieve a single character to represent a log level.

char const * omniClientGetLogLevelString(OmniClientLogLevel level)

Retrieve a human readable string for a log level.

void omniClientLog(char const *component, OmniClientLogLevel level, char const *message)

Write a message to the Client Library log.

void omniClientSetLogCallback(OmniClientLogCallback callback)

Set a log callback function.

void omniClientSetLogLevel(OmniClientLogLevel level)

Set the log level.

Typedefs Summary#

OmniClientLogCallback

This is called from a background thread any time the library wants to print a message to the log.

Enumerations#

enum OmniClientLogLevel#

Log Level.

Values:

enumerator eOmniClientLogLevel_Debug#

Extra chatty.

enumerator eOmniClientLogLevel_Verbose#

Chatty.

enumerator eOmniClientLogLevel_Info#

Not a problem.

enumerator eOmniClientLogLevel_Warning#

Potential problem.

enumerator eOmniClientLogLevel_Error#

Definite problem.

enumerator Count_eOmniClientLogLevel#

Functions#

char omniClientGetLogLevelChar(OmniClientLogLevel level)#

Retrieve a single character to represent a log level.

For example omniClientGetLogLevelChar(eOmniClientLogLevel_Verbose) returns V

Parameters:

level – The log level to get the character for

Returns:

A single character representing the log level

char const *omniClientGetLogLevelString(OmniClientLogLevel level)#

Retrieve a human readable string for a log level.

For example omniClientGetLogLevelString(eOmniClientLogLevel_Verbose) returns Verbose

Parameters:

level – The log level to get the string for

Returns:

A human-readable string for the log level

void omniClientLog(
char const *component,
OmniClientLogLevel level,
char const *message,
)#

Write a message to the Client Library log.

This uses the same log level and callback configured through omniClientSetLogLevel and omniClientSetLogCallback.

Parameters:
  • component – The component name to associate with the message.

  • level – The log level for the message.

  • message – The message to log.

void omniClientSetLogCallback(OmniClientLogCallback callback)#

Set a log callback function.

This sets a function that will be called when the library wants to write anything to a log. By default, messages at Info level and above are written to stderr. Call this to replace that default, or pass nullptr to silence logging entirely. This is the only function that’s safe to call before omniClientInitialize.

Parameters:

callback – The callback function to register, or nullptr to silence logging

void omniClientSetLogLevel(OmniClientLogLevel level)#

Set the log level.

Any messages below this level will not be logged.

Parameters:

level – The minimum log level to display

Typedefs#

typedef void (*OmniClientLogCallback)(char const *threadName, char const *component, OmniClientLogLevel level, char const *message)#

This is called from a background thread any time the library wants to print a message to the log.