21#include "cbl/CBLLogSinks.h"
23#include "cbl/CBLDefaults.h"
125 static CustomLogSink fromCConfiguration(
const CBLCustomLogSink& cSink) {
129 static FileLogSink fromCConfiguration(
const CBLFileLogSink& cSink) {
#define CBL_ASSUME_NONNULL_END
#define CBL_ASSUME_NONNULL_BEGIN
Controls where Couchbase Lite writes its log messages.
Definition LogSinks.hh:76
static void setConsole(const ConsoleLogSink &sink)
Sets the console log sink.
Definition LogSinks.hh:80
static ConsoleLogSink console()
Returns the current console log sink.
Definition LogSinks.hh:86
static FileLogSink file()
Returns the current file log sink.
Definition LogSinks.hh:116
static CustomLogSink custom()
Returns the current custom log sink.
Definition LogSinks.hh:98
static void setCustom(const CustomLogSink &sink)
Sets the custom log sink, whose callback receives each log message.
Definition LogSinks.hh:93
static void setFile(FileLogSink sink)
Sets the file log sink, which writes log messages to files in a directory.
Definition LogSinks.hh:105
void CBLLogSinks_SetCustom(CBLCustomLogSink sink)
CBLCustomLogSink CBLLogSinks_CustomSink(void)
void CBLLogSinks_SetConsole(CBLConsoleLogSink sink)
void CBLLogSinks_SetFile(CBLFileLogSink sink)
CBLFileLogSink CBLLogSinks_File(void)
void(* CBLLogSinkCallback)(CBLLogDomain domain, CBLLogLevel level, FLString message)
CBLConsoleLogSink CBLLogSinks_Console(void)
CBL_PUBLIC const bool kCBLDefaultFileLogSinkUsePlaintext
CBL_PUBLIC const size_t kCBLDefaultFileLogSinkMaxSize
CBL_PUBLIC const uint32_t kCBLDefaultFileLogSinkMaxKeptFiles
fleece::slice slice
Convenience alias for fleece::slice, a non-owning view of a byte range.
Definition Base.hh:49
CBLLogDomainMask LogDomainMask
Definition LogSinks.hh:29
CBLLogLevel LogLevel
Definition LogSinks.hh:31
CBLLogDomain LogDomain
Definition LogSinks.hh:32
CBLLogSinkCallback LogSinkCallback
Definition LogSinks.hh:30
CBLLogSinkCallback _cbl_nullable callback
Console log sink configuration for logging to the console.
Definition LogSinks.hh:35
LogLevel level
The minimum level of message to write (Required).
Definition LogSinks.hh:36
LogDomainMask domains
Bitmask for enabled log domains. Use zero for all domains.
Definition LogSinks.hh:37
Custom log sink configuration for logging to a user-defined callback.
Definition LogSinks.hh:45
LogSinkCallback _Nullable callback
Custom log callback.
Definition LogSinks.hh:47
LogDomainMask domains
Bitmask for enabled log domains. Use zero for all domains.
Definition LogSinks.hh:48
LogLevel level
The minimum level of message to write (Required).
Definition LogSinks.hh:46
File log sink configuration for logging to files.
Definition LogSinks.hh:56
uint32_t maxKeptFiles
The maximum number of files to save per log level.
Definition LogSinks.hh:62
bool usePlaintext
Whether or not to log in plaintext as opposed to binary.
Definition LogSinks.hh:70
std::string directory
The directory where log files will be created (Required).
Definition LogSinks.hh:58
LogLevel level
The minimum level of message to write (Required).
Definition LogSinks.hh:57
size_t maxSize
The size in bytes at which a file will be rotated out (best effort).
Definition LogSinks.hh:66