C++ Server-Side SDK
LaunchDarkly SDK
logging_builder.h
Go to the documentation of this file.
1 
2 // NOLINTBEGIN modernize-use-using
3 
4 #pragma once
5 
7 
10 
11 #include <stdbool.h>
12 #include <stddef.h>
13 
14 #ifdef __cplusplus
15 extern "C" { // only need to export C interface if
16 // used by C++ source code
17 #endif
18 
19 typedef struct _LDLoggingBasicBuilder* LDLoggingBasicBuilder;
20 typedef struct _LDLoggingCustomBuilder* LDLoggingCustomBuilder;
21 
22 typedef bool (*EnabledFn)(enum LDLogLevel level, void* user_data);
23 typedef void (*WriteFn)(enum LDLogLevel level,
24  char const* msg,
25  void* user_data);
26 
30 struct LDLogBackend {
36  EnabledFn Enabled;
37 
44  WriteFn Write;
45 
49  void* UserData;
50 };
51 
57 LD_EXPORT(void)
59 
67 LD_EXPORT(LDLoggingBasicBuilder)
69 
75 LD_EXPORT(void)
76 LDLoggingBasicBuilder_Free(LDLoggingBasicBuilder b);
77 
83 LD_EXPORT(void)
84 LDLoggingBasicBuilder_Level(LDLoggingBasicBuilder b, enum LDLogLevel level);
85 
95 LD_EXPORT(void)
96 LDLoggingBasicBuilder_Tag(LDLoggingBasicBuilder b, char const* tag);
97 
105 LD_EXPORT(LDLoggingCustomBuilder)
107 
113 LD_EXPORT(void)
114 LDLoggingCustomBuilder_Free(LDLoggingCustomBuilder b);
115 
122 LD_EXPORT(void)
123 LDLoggingCustomBuilder_Backend(LDLoggingCustomBuilder b,
124  struct LDLogBackend backend);
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 // NOLINTEND modernize-use-using
Export macros for C bindings.
LDLogLevel
Definition: log_level.h:22
LDLoggingBasicBuilder_Tag(LDLoggingBasicBuilder b, char const *tag)
Definition: logging_builder.cpp:45
LDLoggingBasicBuilder_Level(LDLoggingBasicBuilder b, enum LDLogLevel level)
Definition: logging_builder.cpp:37
LDLoggingCustomBuilder_Free(LDLoggingCustomBuilder b)
LDLoggingBasicBuilder_Free(LDLoggingBasicBuilder b)
LDLoggingBasicBuilder_New()
LDLogBackend_Init(struct LDLogBackend *backend)
LDLoggingCustomBuilder_Backend(LDLoggingCustomBuilder b, struct LDLogBackend backend)
Definition: logging_builder.cpp:61
LDLoggingCustomBuilder_New()
Definition: logging_builder.h:30
void * UserData
Definition: logging_builder.h:49
WriteFn Write
Definition: logging_builder.h:44
EnabledFn Enabled
Definition: logging_builder.h:36