author | Mikael Berthe <mikael@lilotux.net> |
Mon, 13 Jun 2022 18:01:27 +0200 | |
changeset 745 | 7785b42dd7bc |
parent 690 | 7ccf2113ec5f |
permissions | -rw-r--r-- |
516
4dd3aa6b83e5
Change the tab width to 4 steps in the emacs headers
Mikael Hallendal <micke@imendio.com>
parents:
515
diff
changeset
|
1 |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
1 | 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 |
|
690
7ccf2113ec5f
Update the postal address of the FSF
Frank Zschockelt <lm@freakysoft.de>
parents:
658
diff
changeset
|
16 |
* License along with this program; if not, see <https://www.gnu.org/licenses> |
1 | 17 |
*/ |
18 |
||
19 |
#ifndef __LM_DEBUG_H__ |
|
20 |
#define __LM_DEBUG_H__ |
|
21 |
||
22 |
#include <glib.h> |
|
23 |
||
658
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
24 |
#define LM_LOG_LEVEL_VERBOSE (1 << (G_LOG_LEVEL_USER_SHIFT)) |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
25 |
#define LM_LOG_LEVEL_NET (1 << (G_LOG_LEVEL_USER_SHIFT + 1)) |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
26 |
#define LM_LOG_LEVEL_PARSER (1 << (G_LOG_LEVEL_USER_SHIFT + 2)) |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
27 |
#define LM_LOG_LEVEL_SSL (1 << (G_LOG_LEVEL_USER_SHIFT + 3)) |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
28 |
#define LM_LOG_LEVEL_SASL (1 << (G_LOG_LEVEL_USER_SHIFT + 4)) |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
29 |
#define LM_LOG_LEVEL_ALL (LM_LOG_LEVEL_NET | \ |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
30 |
LM_LOG_LEVEL_VERBOSE | \ |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
31 |
LM_LOG_LEVEL_PARSER | \ |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
32 |
LM_LOG_LEVEL_SSL | \ |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
33 |
LM_LOG_LEVEL_SASL) |
352d622c2401
fix compilation warnings
Johannes Wienke <languitar@semipol.de>
parents:
518
diff
changeset
|
34 |
typedef GLogLevelFlags LmLogLevelFlags; |
1 | 35 |
|
109
c8ce6eaa3a4b
2005-03-31 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
99
diff
changeset
|
36 |
#ifndef LM_LOG_DOMAIN |
1 | 37 |
# define LM_LOG_DOMAIN "LM" |
38 |
#endif |
|
39 |
||
40 |
#ifdef G_HAVE_ISO_VARARGS |
|
41 |
# ifdef LM_NO_DEBUG |
|
42 |
# define lm_verbose(...) |
|
43 |
# else |
|
44 |
# define lm_verbose(...) \ |
|
45 |
g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE, __VA_ARGS__) |
|
46 |
# endif |
|
47 |
#elif defined(G_HAVE_GNUC_VARARGS) |
|
48 |
# if LM_NO_DEBUG |
|
49 |
# define lm_verbose(fmt...) |
|
50 |
# else |
|
51 |
# define lm_verbose(fmt...) \ |
|
52 |
g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE, fmt) |
|
53 |
# endif |
|
54 |
#else |
|
55 |
# if LM_NO_DEBUG |
|
56 |
# define lm_verbose(const gchar *format, ...) {}; |
|
57 |
# else |
|
58 |
static void |
|
59 |
lm_verbose (const gchar *format, ...) |
|
60 |
{ |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
61 |
va_list args; |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
62 |
va_start (args, format); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
63 |
g_logv (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE, format, args); |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
64 |
va_end (args); |
1 | 65 |
} |
66 |
# endif |
|
67 |
#endif |
|
68 |
||
69 |
void lm_debug_init (void); |
|
70 |
||
71 |
#endif /* __LM_DEBUG_H__ */ |
|
72 |