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

Manages Couchbase Lite logging configuration, with three log sinks: More...

Data Structures

struct  CBLConsoleLogSink
 Console log sink configuration for logging to the cosole. More...
 
struct  CBLCustomLogSink
 Custom log sink configuration for logging to a user-defined callback. More...
 
struct  CBLFileLogSink
 File log sink configuration for logging to files. More...
 

Typedefs

typedef void(* CBLLogSinkCallback) (CBLLogDomain domain, CBLLogLevel level, FLString message)
 A callback function for a custom log sink. More...
 

Enumerations

enum  CBLLogLevel : uint8_t {
  kCBLLogDebug , kCBLLogVerbose , kCBLLogInfo , kCBLLogWarning ,
  kCBLLogError , kCBLLogNone
}
 The severity level of log messages. More...
 
enum  CBLLogDomain : uint8_t {
  kCBLLogDomainDatabase , kCBLLogDomainQuery , kCBLLogDomainReplicator , kCBLLogDomainNetwork ,
  kCBLLogDomainListener
}
 Subsystems for logging messages. More...
 
enum  CBLLogDomainMask : uint16_t {
  kCBLLogDomainMaskDatabase = 1 << kCBLLogDomainDatabase , kCBLLogDomainMaskQuery = 1 << kCBLLogDomainQuery , kCBLLogDomainMaskReplicator = 1 << kCBLLogDomainReplicator , kCBLLogDomainMaskNetwork = 1 << kCBLLogDomainNetwork ,
  kCBLLogDomainMaskListener = 1 << kCBLLogDomainListener , kCBLLogDomainMaskAll = 0xFF
}
 A bitmask representing a set of logging domains. More...
 

Functions

void CBLLogSinks_SetConsole (CBLConsoleLogSink sink)
 Set the console log sink. More...
 
CBLConsoleLogSink CBLLogSinks_Console (void)
 Get the current console log sink. More...
 
void CBLLogSinks_SetCustom (CBLCustomLogSink sink)
 Set the custom log sink. More...
 
CBLCustomLogSink CBLLogSinks_CustomSink (void)
 Get the current custom log sink. More...
 
void CBLLogSinks_SetFile (CBLFileLogSink sink)
 Set the file log sink. More...
 
CBLFileLogSink CBLLogSinks_File (void)
 Get the current custom log sink. More...
 

Detailed Description

Manages Couchbase Lite logging configuration, with three log sinks:

Typedef Documentation

◆ CBLLogSinkCallback

typedef void(* CBLLogSinkCallback) (CBLLogDomain domain, CBLLogLevel level, FLString message)

A callback function for a custom log sink.

Parameters
domainThe domain of the message
levelThe severity level of the message.
messageThe actual formatted message.

Enumeration Type Documentation

◆ CBLLogDomain

enum CBLLogDomain : uint8_t

Subsystems for logging messages.

Enumerator
kCBLLogDomainDatabase 

Logging domain for the database subsystem.

kCBLLogDomainQuery 

Logging domain for the query subsystem.

kCBLLogDomainReplicator 

Logging domain for the replicator subsystem.

kCBLLogDomainNetwork 

Logging domain for the network subsystem.

kCBLLogDomainListener 

Logging domain for the listener subsystem.

◆ CBLLogDomainMask

enum CBLLogDomainMask : uint16_t

A bitmask representing a set of logging domains.

Use this bitmask to specify one or more logging domains by combining the constants with the bitwise OR operator (|). This is helpful for enabling or filtering logs for specific domains.

Enumerator
kCBLLogDomainMaskDatabase 
kCBLLogDomainMaskQuery 
kCBLLogDomainMaskReplicator 
kCBLLogDomainMaskNetwork 
kCBLLogDomainMaskListener 
kCBLLogDomainMaskAll 

◆ CBLLogLevel

enum CBLLogLevel : uint8_t

The severity level of log messages.

Enumerator
kCBLLogDebug 

Debug-level messages with highly detailed information, Available only in debug builds of Couchbase Lite.

kCBLLogVerbose 

Verbose messages providing detailed operational information.

kCBLLogInfo 

Info messages about normal application behavior.

kCBLLogWarning 

Warning messages indicating potential issues or unusual conditions.

kCBLLogError 

Error messages indicating a failure or problem that occurred.

kCBLLogNone 

Disables logging entirely. No messages will be logged.

Function Documentation

◆ CBLLogSinks_Console()

CBLConsoleLogSink CBLLogSinks_Console ( void  )

Get the current console log sink.

The console log sink is enabled at the warning level for all domains by default.

◆ CBLLogSinks_CustomSink()

CBLCustomLogSink CBLLogSinks_CustomSink ( void  )

Get the current custom log sink.

The custom log sink is disabled by default.

◆ CBLLogSinks_File()

CBLFileLogSink CBLLogSinks_File ( void  )

Get the current custom log sink.

The file log sink is disabled by default.

◆ CBLLogSinks_SetConsole()

void CBLLogSinks_SetConsole ( CBLConsoleLogSink  sink)

Set the console log sink.

To disable the console log sink, set the log level to kCBLLogNone.

◆ CBLLogSinks_SetCustom()

void CBLLogSinks_SetCustom ( CBLCustomLogSink  sink)

Set the custom log sink.

To disable the custom log sink, set the log level to kCBLLogNone.

◆ CBLLogSinks_SetFile()

void CBLLogSinks_SetFile ( CBLFileLogSink  sink)

Set the file log sink.

To disable the file log sink, set the log level to kCBLLogNone.