doc
csync_log.h
Go to the documentation of this file.
1 /*
2  * libcsync -- a library to sync a directory with another
3  *
4  * Copyright (c) 2006-2012 by Andreas Schneider <asn@cryptomilk.org>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 /**
22  * @file csync_log.h
23  *
24  * @brief Logging interface of csync
25  *
26  * @defgroup csyncLogInternals csync logging internals
27  * @ingroup csyncInternalAPI
28  *
29  * @{
30  */
31 
32 #ifndef _CSYNC_LOG_H
33 #define _CSYNC_LOG_H
34 
35 /* GCC have printf type attribute check. */
36 #ifndef PRINTF_ATTRIBUTE
37 #ifdef __GNUC__
38 #ifdef _WIN32
39 #define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__gnu_printf__, a, b)))
40 #else
41 #define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
42 #endif
43 #else
44 #define PRINTF_ATTRIBUTE(a,b)
45 #endif /* __GNUC__ */
46 #endif /* ndef PRINTF_ATTRIBUTE */
47 
61 };
62 
63 #define CSYNC_LOG(priority, ...) \
64  csync_log(ctx, priority, __FUNCTION__, __VA_ARGS__)
65 
66 void csync_log(CSYNC *ctx,
67  int verbosity,
68  const char *function,
69  const char *format, ...) PRINTF_ATTRIBUTE(4, 5);
70 
71 /**
72  * }@
73  */
74 #endif /* _CSYNC_LOG_H */
75 
76 /* vim: set ft=c.doxygen ts=4 sw=4 et cindent: */