C Server-Side SDK
LaunchDarkly SDK
logging.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <launchdarkly/export.h>
9 
11 typedef enum
12 {
13  LD_LOG_FATAL = 0,
14  LD_LOG_CRITICAL,
15  LD_LOG_ERROR,
16  LD_LOG_WARNING,
17  LD_LOG_INFO,
18  LD_LOG_DEBUG,
19  LD_LOG_TRACE
20 } LDLogLevel;
21 
23 LD_EXPORT(void) LDi_log(const LDLogLevel level, const char *const format, ...);
24 
29 LD_EXPORT(void) LDBasicLogger(const LDLogLevel level, const char *const text);
30 
36 
42 LD_EXPORT(void)
43 LDBasicLoggerThreadSafe(const LDLogLevel level, const char *const text);
44 
51 
61 LD_EXPORT(void)
63  const LDLogLevel level,
64  void (*logger)(const LDLogLevel level, const char *const text));
65 
67 #define LD_LOG(level, text) \
68  LDi_log(level, "[%s, %d] %s", __FILE__, __LINE__, text)
69 
76 LD_EXPORT(const char *) LDLogLevelToString(const LDLogLevel level);
LDBasicLogger
void LDBasicLogger(const LDLogLevel level, const char *const text)
A provided logger that can be used as a convenient default.
LDBasicLoggerThreadSafe
void LDBasicLoggerThreadSafe(const LDLogLevel level, const char *const text)
A provided logger that can be used as a convenient default. Must call LDBasicLoggerTSInitialize befor...
LD_EXPORT
#define LD_EXPORT(x)
Used to ensure only intended symbols are exported in the binaries.
Definition: export.h:10
LDLogLevel
LDLogLevel
The log levels compatible with the logging interface.
Definition: logging.h:11
LDBasicLoggerThreadSafeShutdown
void LDBasicLoggerThreadSafeShutdown(void)
Shutdown routine for LDBasicLoggerThreadSafe Call this when LDBasicLoggerThreadSafe is no longer used...
LDBasicLoggerThreadSafeInitialize
void LDBasicLoggerThreadSafeInitialize(void)
Setup routine for LDBasicLoggerThreadSafe. Call this before LDBasicLoggerThreadSafe is used.
LDLogLevelToString
const char * LDLogLevelToString(const LDLogLevel level)
Convert a verbosity level Enum value to an equivalent static string. This is intended as a convenienc...
LDConfigureGlobalLogger
void LDConfigureGlobalLogger(const LDLogLevel level, void(*logger)(const LDLogLevel level, const char *const text))
Set the logger, and the log level to use. This routine should only be used before any other LD routin...
LDi_log
void LDi_log(const LDLogLevel level, const char *const format,...)
Internal: Used for the non macro portion.
export.h
Public. Configuration of exported symbols.