Couchbase Lite C
Couchbase Lite C API
Data Structures | Functions
Logging (Deprecated)

Managing messages that Couchbase Lite logs at runtime. More...

Data Structures

struct  CBLLogFileConfiguration
 The properties for configuring logging to files. More...
 

Functions

void CBL_Log (CBLLogDomain domain, CBLLogLevel level, const char *format,...) __printflike(3
 Formats and writes a message to the log, in the given domain at the given level. More...
 
void void CBL_LogMessage (CBLLogDomain domain, CBLLogLevel level, FLSlice message)
 Writes a pre-formatted message to the log, exactly as given. More...
 

Console Logging and Custom Logging

typedef CBLLogSinkCallback CBLLogCallback
 A logging callback that the application can register. More...
 
CBLLogLevel CBLLog_ConsoleLevel (void)
 Gets the current log level for debug console logging. More...
 
void CBLLog_SetConsoleLevel (CBLLogLevel)
 Sets the detail level of logging. More...
 
CBLLogLevel CBLLog_CallbackLevel (void)
 Gets the current log level for debug console logging. More...
 
void CBLLog_SetCallbackLevel (CBLLogLevel)
 Sets the detail level of logging. More...
 
CBLLogCallback CBLLog_Callback (void)
 Gets the current log callback. More...
 
void CBLLog_SetCallback (CBLLogCallback _cbl_nullable callback)
 Sets the callback for receiving log messages. More...
 

Log File Configuration

const CBLLogFileConfiguration *_cbl_nullable CBLLog_FileConfig (void)
 Gets the current file logging configuration, or NULL if none is configured. More...
 
bool CBLLog_SetFileConfig (CBLLogFileConfiguration, CBLError *_cbl_nullable outError)
 Sets the file logging configuration, and begins logging to files. More...
 

Detailed Description

Managing messages that Couchbase Lite logs at runtime.

Typedef Documentation

◆ CBLLogCallback

A logging callback that the application can register.

Function Documentation

◆ CBL_Log()

void CBL_Log ( CBLLogDomain  domain,
CBLLogLevel  level,
const char *  format,
  ... 
)

Formats and writes a message to the log, in the given domain at the given level.

Warning
This function takes a printf-style format string, with extra parameters to match the format placeholders, and has the same security vulnerabilities as other printf-style functions.

If you are logging a fixed string, call CBL_LogMessage instead, otherwise any % characters in the format string will be misinterpreted as placeholders and the dreaded Undefined Behavior will result, possibly including crashes or overwriting the stack.

Parameters
domainThe log domain to associate this message with.
levelThe severity of the message. If this is lower than the current minimum level for the domain (as set by CBLLog_SetConsoleLevel), nothing is logged.
formatA printf-style format string. % characters in this string introduce parameters, and corresponding arguments must follow.
Warning
Deprecated : No alternative for this function and this function will be removed in the future release.

◆ CBL_LogMessage()

void void CBL_LogMessage ( CBLLogDomain  domain,
CBLLogLevel  level,
FLSlice  message 
)

Writes a pre-formatted message to the log, exactly as given.

Parameters
domainThe log domain to associate this message with.
levelThe severity of the message. If this is lower than the current minimum level for the domain (as set by CBLLog_SetConsoleLevel), nothing is logged.
messageThe exact message to write to the log.
Warning
Deprecated : No alternative for this function and this function will be removed in the future release.

◆ CBLLog_Callback()

CBLLogCallback CBLLog_Callback ( void  )

Gets the current log callback.

Warning
Deprecated : Use CBLLogSinks_CustomSink instead.

◆ CBLLog_CallbackLevel()

CBLLogLevel CBLLog_CallbackLevel ( void  )

Gets the current log level for debug console logging.

Only messages at this level or higher will be logged to the callback.

Warning
Deprecated : Use CBLLogSinks_CustomSink instead.

◆ CBLLog_ConsoleLevel()

CBLLogLevel CBLLog_ConsoleLevel ( void  )

Gets the current log level for debug console logging.

Only messages at this level or higher will be logged to the console.

Warning
Deprecated : Use CBLLogSinks_Console instead.

◆ CBLLog_FileConfig()

const CBLLogFileConfiguration *_cbl_nullable CBLLog_FileConfig ( void  )

Gets the current file logging configuration, or NULL if none is configured.

Warning
Deprecated : Use CBLLogSinks_File instead.

◆ CBLLog_SetCallback()

void CBLLog_SetCallback ( CBLLogCallback _cbl_nullable  callback)

Sets the callback for receiving log messages.

If set to NULL, no messages are logged to the console.

Warning
Deprecated : Use CBLLogSinks_SetCustom instead.

◆ CBLLog_SetCallbackLevel()

void CBLLog_SetCallbackLevel ( CBLLogLevel  )

Sets the detail level of logging.

Only messages whose level is ≥ the given level will be logged to the callback.

Warning
Deprecated : Use CBLLogSinks_SetCustom instead.

◆ CBLLog_SetConsoleLevel()

void CBLLog_SetConsoleLevel ( CBLLogLevel  )

Sets the detail level of logging.

Only messages whose level is ≥ the given level will be logged to the console.

Warning
Deprecated : Use CBLLogSinks_SetConsole instead.

◆ CBLLog_SetFileConfig()

bool CBLLog_SetFileConfig ( CBLLogFileConfiguration  ,
CBLError *_cbl_nullable  outError 
)

Sets the file logging configuration, and begins logging to files.

Warning
Deprecated : Use CBLLogSinks_SetFile instead.