author | Martyn Russell <martyn@imendio.com> |
Thu, 28 Feb 2008 02:52:37 +0100 | |
changeset 348 | 48fdfa327cc7 |
parent 255 | 704881ac7788 |
child 515 | fb0f1adfa271 |
permissions | -rw-r--r-- |
1 | 1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
2 |
/* |
|
99
81e9d035de02
2004-10-05 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
84
diff
changeset
|
3 |
* Copyright (C) 2003 Imendio AB |
1 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU Lesser General Public License as |
|
7 |
* published by the Free Software Foundation; either version 2 of the |
|
8 |
* License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 |
* Lesser General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU Lesser General Public |
|
16 |
* License along with this program; if not, write to the |
|
17 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
18 |
* Boston, MA 02111-1307, USA. |
|
19 |
*/ |
|
20 |
||
21 |
#ifndef __LM_DEBUG_H__ |
|
22 |
#define __LM_DEBUG_H__ |
|
23 |
||
24 |
#include <glib.h> |
|
25 |
||
26 |
typedef enum { |
|
27 |
LM_LOG_LEVEL_VERBOSE = 1 << (G_LOG_LEVEL_USER_SHIFT), |
|
28 |
LM_LOG_LEVEL_NET = 1 << (G_LOG_LEVEL_USER_SHIFT + 1), |
|
29 |
LM_LOG_LEVEL_PARSER = 1 << (G_LOG_LEVEL_USER_SHIFT + 2), |
|
213
27567fb5d37b
Use g_warning and g_log for warnings and debug printouts in OpenSSL backend.
Mikael Hallendal <micke@imendio.com>
parents:
109
diff
changeset
|
30 |
LM_LOG_LEVEL_SSL = 1 << (G_LOG_LEVEL_USER_SHIFT + 3), |
255
704881ac7788
Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents:
213
diff
changeset
|
31 |
LM_LOG_LEVEL_SASL = 1 << (G_LOG_LEVEL_USER_SHIFT + 4), |
1 | 32 |
LM_LOG_LEVEL_ALL = (LM_LOG_LEVEL_NET | |
33 |
LM_LOG_LEVEL_VERBOSE | |
|
213
27567fb5d37b
Use g_warning and g_log for warnings and debug printouts in OpenSSL backend.
Mikael Hallendal <micke@imendio.com>
parents:
109
diff
changeset
|
34 |
LM_LOG_LEVEL_PARSER | |
255
704881ac7788
Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents:
213
diff
changeset
|
35 |
LM_LOG_LEVEL_SSL | |
704881ac7788
Fixed potential problem if auth was not called from the open callback.
Mikael Hallendal <micke@imendio.com>
parents:
213
diff
changeset
|
36 |
LM_LOG_LEVEL_SASL) |
1 | 37 |
} LmLogLevelFlags; |
38 |
||
109
c8ce6eaa3a4b
2005-03-31 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
99
diff
changeset
|
39 |
#ifndef LM_LOG_DOMAIN |
1 | 40 |
# define LM_LOG_DOMAIN "LM" |
41 |
#endif |
|
42 |
||
43 |
#ifdef G_HAVE_ISO_VARARGS |
|
44 |
# ifdef LM_NO_DEBUG |
|
45 |
# define lm_verbose(...) |
|
46 |
# else |
|
47 |
# define lm_verbose(...) \ |
|
48 |
g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE, __VA_ARGS__) |
|
49 |
# endif |
|
50 |
#elif defined(G_HAVE_GNUC_VARARGS) |
|
51 |
# if LM_NO_DEBUG |
|
52 |
# define lm_verbose(fmt...) |
|
53 |
# else |
|
54 |
# define lm_verbose(fmt...) \ |
|
55 |
g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE, fmt) |
|
56 |
# endif |
|
57 |
#else |
|
58 |
# if LM_NO_DEBUG |
|
59 |
# define lm_verbose(const gchar *format, ...) {}; |
|
60 |
# else |
|
61 |
static void |
|
62 |
lm_verbose (const gchar *format, ...) |
|
63 |
{ |
|
64 |
va_list args; |
|
65 |
va_start (args, format); |
|
66 |
g_logv (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE, format, args); |
|
67 |
va_end (args); |
|
68 |
} |
|
69 |
# endif |
|
70 |
#endif |
|
71 |
||
72 |
void lm_debug_init (void); |
|
73 |
||
74 |
#endif /* __LM_DEBUG_H__ */ |
|
75 |