PostGIS  2.2.7dev-r@@SVN_REVISION@@
lwgeom_log.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * PostGIS - Spatial Types for PostgreSQL
4  * http://postgis.net
5  *
6  * Copyright 2011 Sandro Santilli <strk@keybit.net>
7  * Copyright 2008 Paul Ramsey <pramsey@cleverelephant.ca>
8  * Copyright 2007-2008 Mark Cave-Ayland
9  * Copyright 2001-2006 Refractions Research Inc.
10  *
11  * This is free software; you can redistribute and/or modify it under
12  * the terms of the GNU General Public Licence. See the COPYING file.
13  *
14  **********************************************************************
15  *
16  * Internal logging routines
17  *
18  **********************************************************************/
19 
20 #ifndef LWGEOM_LOG_H
21 #define LWGEOM_LOG_H 1
22 
23 #include <stdarg.h>
24 
25 /*
26  * Debug macros
27  */
28 #if POSTGIS_DEBUG_LEVEL > 0
29 
30 /* Display a notice at the given debug level */
31 #define LWDEBUG(level, msg) \
32  do { \
33  if (POSTGIS_DEBUG_LEVEL >= level) \
34  lwdebug(level, "[%s:%s:%d] " msg, __FILE__, __func__, __LINE__); \
35  } while (0);
36 
37 /* Display a formatted notice at the given debug level
38  * (like printf, with variadic arguments) */
39 #define LWDEBUGF(level, msg, ...) \
40  do { \
41  if (POSTGIS_DEBUG_LEVEL >= level) \
42  lwdebug(level, "[%s:%s:%d] " msg, \
43  __FILE__, __func__, __LINE__, __VA_ARGS__); \
44  } while (0);
45 
46 #else /* POSTGIS_DEBUG_LEVEL <= 0 */
47 
48 /* Empty prototype that can be optimised away by the compiler
49  * for non-debug builds */
50 #define LWDEBUG(level, msg) \
51  ((void) 0)
52 
53 /* Empty prototype that can be optimised away by the compiler
54  * for non-debug builds */
55 #define LWDEBUGF(level, msg, ...) \
56  ((void) 0)
57 
58 #endif /* POSTGIS_DEBUG_LEVEL <= 0 */
59 
68 void lwnotice(const char *fmt, ...);
69 
78 void lwerror(const char *fmt, ...);
79 
87 void lwdebug(int level, const char *fmt, ...);
88 
89 
90 
91 #endif /* LWGEOM_LOG_H */
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:61
tuple fmt
Definition: pixval.py:92
void lwdebug(int level, const char *fmt,...)
Write a debug message out.
Definition: lwutil.c:87
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74