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) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library 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 GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, 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#ifdef __GNUC__
37#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
38#else
39#define PRINTF_ATTRIBUTE(a,b)
40#endif /* __GNUC__ */
41
55};
56
57#define CSYNC_LOG(priority, ...) \
58 csync_log(priority, __func__, __VA_ARGS__)
59
60void csync_log(int verbosity,
61 const char *function,
62 const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
63
64/**
65 * }@
66 */
67#endif /* _CSYNC_LOG_H */
68
69/* vim: set ft=c.doxygen ts=4 sw=4 et cindent: */
void csync_log(int verbosity, const char *function, const char *format,...) PRINTF_ATTRIBUTE(3
#define PRINTF_ATTRIBUTE(a, b)
Definition: csync_log.h:39
csync_log_priority_e
Definition: csync_log.h:42
@ CSYNC_LOG_PRIORITY_NOTSET
Definition: csync_log.h:53
@ CSYNC_LOG_PRIORITY_NOTICE
Definition: csync_log.h:49
@ CSYNC_LOG_PRIORITY_UNKNOWN
Definition: csync_log.h:54
@ CSYNC_LOG_PRIORITY_WARN
Definition: csync_log.h:48
@ CSYNC_LOG_PRIORITY_ERROR
Definition: csync_log.h:47
@ CSYNC_LOG_PRIORITY_NOLOG
Definition: csync_log.h:43
@ CSYNC_LOG_PRIORITY_DEBUG
Definition: csync_log.h:51
@ CSYNC_LOG_PRIORITY_FATAL
Definition: csync_log.h:44
@ CSYNC_LOG_PRIORITY_ALERT
Definition: csync_log.h:45
@ CSYNC_LOG_PRIORITY_CRIT
Definition: csync_log.h:46
@ CSYNC_LOG_PRIORITY_INFO
Definition: csync_log.h:50
@ CSYNC_LOG_PRIORITY_TRACE
Definition: csync_log.h:52