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
#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
48
enum
csync_log_priority_e
{
49
CSYNC_LOG_PRIORITY_NOLOG
= 0,
50
CSYNC_LOG_PRIORITY_FATAL
,
51
CSYNC_LOG_PRIORITY_ALERT
,
52
CSYNC_LOG_PRIORITY_CRIT
,
53
CSYNC_LOG_PRIORITY_ERROR
,
54
CSYNC_LOG_PRIORITY_WARN
,
55
CSYNC_LOG_PRIORITY_NOTICE
,
56
CSYNC_LOG_PRIORITY_INFO
,
57
CSYNC_LOG_PRIORITY_DEBUG
,
58
CSYNC_LOG_PRIORITY_TRACE
,
59
CSYNC_LOG_PRIORITY_NOTSET
,
60
CSYNC_LOG_PRIORITY_UNKNOWN
,
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: */
csync_log_priority_e
csync_log_priority_e
Definition:
csync_log.h:48
CSYNC_LOG_PRIORITY_FATAL
Definition:
csync_log.h:50
CSYNC_LOG_PRIORITY_UNKNOWN
Definition:
csync_log.h:60
CSYNC_LOG_PRIORITY_ALERT
Definition:
csync_log.h:51
CSYNC_LOG_PRIORITY_NOLOG
Definition:
csync_log.h:49
CSYNC_LOG_PRIORITY_INFO
Definition:
csync_log.h:56
csync_log
void csync_log(CSYNC *ctx, int verbosity, const char *function, const char *format,...) PRINTF_ATTRIBUTE(4
csync_s
csync public structure
Definition:
csync_private.h:88
CSYNC_LOG_PRIORITY_NOTSET
Definition:
csync_log.h:59
CSYNC_LOG_PRIORITY_ERROR
Definition:
csync_log.h:53
CSYNC_LOG_PRIORITY_WARN
Definition:
csync_log.h:54
PRINTF_ATTRIBUTE
#define PRINTF_ATTRIBUTE(a, b)
Definition:
csync_log.h:44
CSYNC_LOG_PRIORITY_CRIT
Definition:
csync_log.h:52
CSYNC_LOG_PRIORITY_NOTICE
Definition:
csync_log.h:55
CSYNC_LOG_PRIORITY_DEBUG
Definition:
csync_log.h:57
CSYNC_LOG_PRIORITY_TRACE
Definition:
csync_log.h:58
Generated by
1.8.6