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.
39
* @brief Local Drizzle Declarations
42
#ifndef __DRIZZLE_LOCAL_H
43
#define __DRIZZLE_LOCAL_H
50
* @addtogroup drizzle_local Local Drizzle Declarations
56
* Set the error string.
58
* @param[in] drizzle Drizzle structure previously initialized with
59
* drizzle_create() or drizzle_clone().
60
* @param[in] function Name of function the error happened in.
61
* @param[in] format Format and variable argument list of message.
64
void drizzle_set_error(drizzle_st *drizzle, const char *function,
65
const char *format, ...);
70
* @param[in] drizzle Drizzle structure previously initialized with
71
* drizzle_create() or drizzle_clone().
72
* @param[in] verbose Logging level of the message.
73
* @param[in] format Format and variable argument list of message.
74
* @param[in] args Variable argument list that has been initialized.
77
void drizzle_log(drizzle_st *drizzle, drizzle_verbose_t verbose,
78
const char *format, va_list args);
81
* Log a fatal message, see drizzle_log() for argument details.
83
static inline void drizzle_log_fatal(drizzle_st *drizzle, const char *format,
88
if (drizzle->verbose >= DRIZZLE_VERBOSE_FATAL)
90
va_start(args, format);
91
drizzle_log(drizzle, DRIZZLE_VERBOSE_FATAL, format, args);
97
* Log an error message, see drizzle_log() for argument details.
99
static inline void drizzle_log_error(drizzle_st *drizzle, const char *format,
104
if (drizzle->verbose >= DRIZZLE_VERBOSE_ERROR)
106
va_start(args, format);
107
drizzle_log(drizzle, DRIZZLE_VERBOSE_ERROR, format, args);
113
* Log an info message, see drizzle_log() for argument details.
115
static inline void drizzle_log_info(drizzle_st *drizzle, const char *format,
120
if (drizzle->verbose >= DRIZZLE_VERBOSE_INFO)
122
va_start(args, format);
123
drizzle_log(drizzle, DRIZZLE_VERBOSE_INFO, format, args);
129
* Log a debug message, see drizzle_log() for argument details.
131
static inline void drizzle_log_debug(drizzle_st *drizzle, const char *format,
136
if (drizzle->verbose >= DRIZZLE_VERBOSE_DEBUG)
138
va_start(args, format);
139
drizzle_log(drizzle, DRIZZLE_VERBOSE_DEBUG, format, args);
145
* Log a crazy message, see drizzle_log() for argument details.
147
static inline void drizzle_log_crazy(drizzle_st *drizzle, const char *format,
152
if (drizzle->verbose >= DRIZZLE_VERBOSE_CRAZY)
154
va_start(args, format);
155
drizzle_log(drizzle, DRIZZLE_VERBOSE_CRAZY, format, args);
166
#endif /* __DRIZZLE_LOCAL_H */