Couchbase Lite C
Couchbase Lite C API
CBLLogSinks.h
Go to the documentation of this file.
1//
2// CBLLogSink.h
3//
4// Copyright © 2024 Couchbase. All rights reserved.
5//
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17//
18
19#pragma once
20#include "CBLBase.h"
21
23
33typedef CBL_ENUM(uint8_t, CBLLogLevel) {
40};
41
43typedef CBL_ENUM(uint8_t, CBLLogDomain) {
49};
50
56typedef CBL_OPTIONS(uint16_t, CBLLogDomainMask) {
63};
64
69typedef void (*CBLLogSinkCallback)(CBLLogDomain domain, CBLLogLevel level, FLString message);
70
72typedef struct {
76
78typedef struct {
83
85typedef struct {
88
91 uint32_t maxKeptFiles;
92
95 size_t maxSize;
96
101
104
107
110
113
116
119
121
#define CBL_OPTIONS(_type, _name)
Definition: CBL_Compat.h:63
#define CBLAPI
Definition: CBL_Compat.h:104
#define _cbl_nullable
Definition: CBL_Compat.h:92
#define CBL_CAPI_BEGIN
Definition: CBL_Compat.h:105
#define CBL_CAPI_END
Definition: CBL_Compat.h:106
#define CBL_ENUM(_type, _name)
Definition: CBL_Compat.h:62
void CBLLogSinks_SetCustom(CBLCustomLogSink sink)
Set the custom log sink.
CBLLogDomainMask
A bitmask representing a set of logging domains.
Definition: CBLLogSinks.h:56
CBLCustomLogSink CBLLogSinks_CustomSink(void)
Get the current custom log sink.
void CBLLogSinks_SetConsole(CBLConsoleLogSink sink)
Set the console log sink.
void CBLLogSinks_SetFile(CBLFileLogSink sink)
Set the file log sink.
CBLFileLogSink CBLLogSinks_File(void)
Get the current custom log sink.
CBLLogDomain
Subsystems for logging messages.
Definition: CBLLogSinks.h:43
CBLLogLevel
The severity level of log messages.
Definition: CBLLogSinks.h:33
void(* CBLLogSinkCallback)(CBLLogDomain domain, CBLLogLevel level, FLString message)
A callback function for a custom log sink.
Definition: CBLLogSinks.h:69
CBLConsoleLogSink CBLLogSinks_Console(void)
Get the current console log sink.
@ kCBLLogDomainMaskNetwork
Definition: CBLLogSinks.h:60
@ kCBLLogDomainMaskQuery
Definition: CBLLogSinks.h:58
@ kCBLLogDomainMaskReplicator
Definition: CBLLogSinks.h:59
@ kCBLLogDomainMaskDatabase
Definition: CBLLogSinks.h:57
@ kCBLLogDomainMaskAll
Definition: CBLLogSinks.h:62
@ kCBLLogDomainMaskListener
Definition: CBLLogSinks.h:61
@ kCBLLogDomainDatabase
Logging domain for the database subsystem.
Definition: CBLLogSinks.h:44
@ kCBLLogDomainReplicator
Logging domain for the replicator subsystem.
Definition: CBLLogSinks.h:46
@ kCBLLogDomainNetwork
Logging domain for the network subsystem.
Definition: CBLLogSinks.h:47
@ kCBLLogDomainListener
Logging domain for the listener subsystem.
Definition: CBLLogSinks.h:48
@ kCBLLogDomainQuery
Logging domain for the query subsystem.
Definition: CBLLogSinks.h:45
@ kCBLLogWarning
Warning messages indicating potential issues or unusual conditions.
Definition: CBLLogSinks.h:37
@ kCBLLogVerbose
Verbose messages providing detailed operational information.
Definition: CBLLogSinks.h:35
@ kCBLLogDebug
Debug-level messages with highly detailed information, Available only in debug builds of Couchbase Li...
Definition: CBLLogSinks.h:34
@ kCBLLogNone
Disables logging entirely. No messages will be logged.
Definition: CBLLogSinks.h:39
@ kCBLLogInfo
Info messages about normal application behavior.
Definition: CBLLogSinks.h:36
@ kCBLLogError
Error messages indicating a failure or problem that occurred.
Definition: CBLLogSinks.h:38
Console log sink configuration for logging to the cosole.
Definition: CBLLogSinks.h:72
CBLLogLevel level
The minimum level of message to write (Required).
Definition: CBLLogSinks.h:73
CBLLogDomainMask domains
Bitmask for enabled log domains. Use zero for all domains.
Definition: CBLLogSinks.h:74
Custom log sink configuration for logging to a user-defined callback.
Definition: CBLLogSinks.h:78
CBLLogLevel level
The minimum level of message to write (Required).
Definition: CBLLogSinks.h:79
CBLLogSinkCallback _cbl_nullable callback
Custom log callback (Required).
Definition: CBLLogSinks.h:80
CBLLogDomainMask domains
Bitmask for enabled log domains. Use zero for all domains.
Definition: CBLLogSinks.h:81
File log sink configuration for logging to files.
Definition: CBLLogSinks.h:85
size_t maxSize
The size in bytes at which a file will be rotated out (best effort).
Definition: CBLLogSinks.h:95
CBLLogLevel level
The minimum level of message to write (Required).
Definition: CBLLogSinks.h:86
FLString directory
The directory where log files will be created (Required).
Definition: CBLLogSinks.h:87
bool usePlaintext
Whether or not to log in plaintext as opposed to binary.
Definition: CBLLogSinks.h:99
uint32_t maxKeptFiles
The maximum number of files to save per log level.
Definition: CBLLogSinks.h:91
A simple reference to a block of memory.
Definition: FLSlice.h:45