2
* Drizzle Client & Protocol Library
4
* Copyright (C) 2008 Eric Day (eday@oddments.org)
7
* Use and distribution licensed under the BSD license. See
8
* the COPYING file in this directory for full text.
13
* @brief Local Drizzle Declarations
16
#ifndef __DRIZZLE_LOCAL_H
17
#define __DRIZZLE_LOCAL_H
24
* @addtogroup drizzle_local Local Drizzle Declarations
30
* Set the error string.
32
* @param[in] drizzle Drizzle structure previously initialized with
33
* drizzle_create() or drizzle_clone().
34
* @param[in] function Name of function the error happened in.
35
* @param[in] format Format and variable argument list of message.
38
void drizzle_set_error(drizzle_st *drizzle, const char *function,
39
const char *format, ...);
44
* @param[in] drizzle Drizzle structure previously initialized with
45
* drizzle_create() or drizzle_clone().
46
* @param[in] verbose Logging level of the message.
47
* @param[in] format Format and variable argument list of message.
48
* @param[in] args Variable argument list that has been initialized.
51
void drizzle_log(drizzle_st *drizzle, drizzle_verbose_t verbose,
52
const char *format, va_list args);
55
* Log a fatal message, see drizzle_log() for argument details.
57
static inline void drizzle_log_fatal(drizzle_st *drizzle, const char *format,
62
if (drizzle->verbose >= DRIZZLE_VERBOSE_FATAL)
64
va_start(args, format);
65
drizzle_log(drizzle, DRIZZLE_VERBOSE_FATAL, format, args);
71
* Log an error message, see drizzle_log() for argument details.
73
static inline void drizzle_log_error(drizzle_st *drizzle, const char *format,
78
if (drizzle->verbose >= DRIZZLE_VERBOSE_ERROR)
80
va_start(args, format);
81
drizzle_log(drizzle, DRIZZLE_VERBOSE_ERROR, format, args);
87
* Log an info message, see drizzle_log() for argument details.
89
static inline void drizzle_log_info(drizzle_st *drizzle, const char *format,
94
if (drizzle->verbose >= DRIZZLE_VERBOSE_INFO)
96
va_start(args, format);
97
drizzle_log(drizzle, DRIZZLE_VERBOSE_INFO, format, args);
103
* Log a debug message, see drizzle_log() for argument details.
105
static inline void drizzle_log_debug(drizzle_st *drizzle, const char *format,
110
if (drizzle->verbose >= DRIZZLE_VERBOSE_DEBUG)
112
va_start(args, format);
113
drizzle_log(drizzle, DRIZZLE_VERBOSE_DEBUG, format, args);
119
* Log a crazy message, see drizzle_log() for argument details.
121
static inline void drizzle_log_crazy(drizzle_st *drizzle, const char *format,
126
if (drizzle->verbose >= DRIZZLE_VERBOSE_CRAZY)
128
va_start(args, format);
129
drizzle_log(drizzle, DRIZZLE_VERBOSE_CRAZY, format, args);
140
#endif /* __DRIZZLE_LOCAL_H */