2
* Drizzle Client & Protocol Library
4
* Copyright (C) 2008 Eric Day (eday@oddments.org)
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are
11
* * Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
14
* * Redistributions in binary form must reproduce the above
15
* copyright notice, this list of conditions and the following disclaimer
16
* in the documentation and/or other materials provided with the
19
* * The names of its contributors may not be used to endorse or
20
* promote products derived from this software without specific prior
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41
* @brief Local Drizzle Declarations
49
* @addtogroup drizzle_local Local Drizzle Declarations
55
* Set the error string.
57
* @param[in] drizzle Drizzle structure previously initialized with
58
* drizzle_create() or drizzle_clone().
59
* @param[in] function Name of function the error happened in.
60
* @param[in] format Format and variable argument list of message.
63
void drizzle_set_error(drizzle_st *drizzle, const char *function,
64
const char *format, ...);
69
* @param[in] drizzle Drizzle structure previously initialized with
70
* drizzle_create() or drizzle_clone().
71
* @param[in] verbose Logging level of the message.
72
* @param[in] format Format and variable argument list of message.
73
* @param[in] args Variable argument list that has been initialized.
76
void drizzle_log(drizzle_st *drizzle, drizzle_verbose_t verbose,
77
const char *format, va_list args);
80
* Log a fatal message, see drizzle_log() for argument details.
82
static inline void drizzle_log_fatal(drizzle_st *drizzle, const char *format,
87
if (drizzle->verbose >= DRIZZLE_VERBOSE_FATAL)
89
va_start(args, format);
90
drizzle_log(drizzle, DRIZZLE_VERBOSE_FATAL, format, args);
96
* Log an error message, see drizzle_log() for argument details.
98
static inline void drizzle_log_error(drizzle_st *drizzle, const char *format,
103
if (drizzle->verbose >= DRIZZLE_VERBOSE_ERROR)
105
va_start(args, format);
106
drizzle_log(drizzle, DRIZZLE_VERBOSE_ERROR, format, args);
112
* Log an info message, see drizzle_log() for argument details.
114
static inline void drizzle_log_info(drizzle_st *drizzle, const char *format,
119
if (drizzle->verbose >= DRIZZLE_VERBOSE_INFO)
121
va_start(args, format);
122
drizzle_log(drizzle, DRIZZLE_VERBOSE_INFO, format, args);
128
* Log a debug message, see drizzle_log() for argument details.
130
static inline void drizzle_log_debug(drizzle_st *drizzle, const char *format,
135
if (drizzle->verbose >= DRIZZLE_VERBOSE_DEBUG)
137
va_start(args, format);
138
drizzle_log(drizzle, DRIZZLE_VERBOSE_DEBUG, format, args);
144
* Log a crazy message, see drizzle_log() for argument details.
146
static inline void drizzle_log_crazy(drizzle_st *drizzle, const char *format,
151
if (drizzle->verbose >= DRIZZLE_VERBOSE_CRAZY)
153
va_start(args, format);
154
drizzle_log(drizzle, DRIZZLE_VERBOSE_CRAZY, format, args);