doc
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
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
#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
42
enum
csync_log_priority_e
{
43
CSYNC_LOG_PRIORITY_NOLOG
= 0,
44
CSYNC_LOG_PRIORITY_FATAL
,
45
CSYNC_LOG_PRIORITY_ALERT
,
46
CSYNC_LOG_PRIORITY_CRIT
,
47
CSYNC_LOG_PRIORITY_ERROR
,
48
CSYNC_LOG_PRIORITY_WARN
,
49
CSYNC_LOG_PRIORITY_NOTICE
,
50
CSYNC_LOG_PRIORITY_INFO
,
51
CSYNC_LOG_PRIORITY_DEBUG
,
52
CSYNC_LOG_PRIORITY_TRACE
,
53
CSYNC_LOG_PRIORITY_NOTSET
,
54
CSYNC_LOG_PRIORITY_UNKNOWN
,
55
};
56
57
#define CSYNC_LOG(priority, ...) \
58
csync_log(ctx, priority, __FUNCTION__, __VA_ARGS__)
59
60
void
csync_log
(
CSYNC
*ctx,
61
int
verbosity,
62
const
char
*
function
,
63
const
char
*format, ...)
PRINTF_ATTRIBUTE
(4, 5);
64
65
/**
66
* }@
67
*/
68
#endif
/* _CSYNC_LOG_H */
69
70
/* vim: set ft=c.doxygen ts=4 sw=4 et cindent: */
Generated by
1.8.1