C++ Server-Side SDK
LaunchDarkly SDK
Classes | Typedefs | Functions
logging_builder.h File Reference
#include <launchdarkly/bindings/c/logging/log_level.h>
#include <launchdarkly/bindings/c/export.h>
#include <launchdarkly/bindings/c/status.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for logging_builder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LDLogBackend
 

Typedefs

typedef struct _LDLoggingBasicBuilder * LDLoggingBasicBuilder
 
typedef struct _LDLoggingCustomBuilder * LDLoggingCustomBuilder
 
typedef bool(* EnabledFn) (enum LDLogLevel level, void *user_data)
 
typedef void(* WriteFn) (enum LDLogLevel level, char const *msg, void *user_data)
 

Functions

 LDLogBackend_Init (struct LDLogBackend *backend)
 
 LDLoggingBasicBuilder_New ()
 
 LDLoggingBasicBuilder_Free (LDLoggingBasicBuilder b)
 
 LDLoggingBasicBuilder_Level (LDLoggingBasicBuilder b, enum LDLogLevel level)
 
 LDLoggingBasicBuilder_Tag (LDLoggingBasicBuilder b, char const *tag)
 
 LDLoggingCustomBuilder_New ()
 
 LDLoggingCustomBuilder_Free (LDLoggingCustomBuilder b)
 
 LDLoggingCustomBuilder_Backend (LDLoggingCustomBuilder b, struct LDLogBackend backend)
 

Function Documentation

◆ LDLogBackend_Init()

LDLogBackend_Init ( struct LDLogBackend backend)

Initializes a custom log backend. Must be called before passing a custom backend into configuration.

Parameters
backendBackend to initialize.

◆ LDLoggingBasicBuilder_Free()

LDLoggingBasicBuilder_Free ( LDLoggingBasicBuilder  b)

Frees a basic logging builder. Do not call if the builder was consumed by the config builder.

Parameters
bBuilder to free.

◆ LDLoggingBasicBuilder_Level()

LDLoggingBasicBuilder_Level ( LDLoggingBasicBuilder  b,
enum LDLogLevel  level 
)

Sets the enabled log level. The default level is LD_LOG_INFO.

Parameters
bClient config builder. Must not be NULL.
levelLevel to set.

◆ LDLoggingBasicBuilder_New()

LDLoggingBasicBuilder_New ( )

Creates a new builder for LaunchDarkly's default logger.

If not passed into the config builder, must be manually freed with LDLoggingBasicBuilder_Free.

Returns
New builder.

◆ LDLoggingBasicBuilder_Tag()

LDLoggingBasicBuilder_Tag ( LDLoggingBasicBuilder  b,
char const *  tag 
)

Set a tag for this logger. This tag will be included at the start of log entries in square brackets.

If the name was "LaunchDarkly", then log entries will be prefixed with "[LaunchDarkly]". The default tag is "LaunchDarkly".

Parameters
bClient config builder. Must not be NULL.
tagTag to set. Must not be NULL.

◆ LDLoggingCustomBuilder_Backend()

LDLoggingCustomBuilder_Backend ( LDLoggingCustomBuilder  b,
struct LDLogBackend  backend 
)

Sets a custom log backend.

Parameters
bCustom logging builder. Must not be NULL.
backendThe backend to use for logging. Ensure the backend was initialized with LDLogBackend_Init.

◆ LDLoggingCustomBuilder_Free()

LDLoggingCustomBuilder_Free ( LDLoggingCustomBuilder  b)

Frees a custom logging builder. Do not call if the builder was consumed by the config builder.

Parameters
bBuilder to free.

◆ LDLoggingCustomBuilder_New()

LDLoggingCustomBuilder_New ( )

Creates a new builder for a custom, user-provided logger.

If not passed into the config builder, must be manually freed with LDLoggingCustomBuilder_Free.

Returns
New builder.