jabberd2
2.3.6
Main Page
Data Structures
Files
File List
Globals
util
log.h
Go to the documentation of this file.
1
/*
2
* jabberd - Jabber Open Source Server
3
* Copyright (c) 2002-2004 Jeremie Miller, Thomas Muldowney,
4
* Ryan Eatmon, Robert Norris
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (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
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
19
*/
20
28
#ifndef INCL_UTIL_LOG_H
29
#define INCL_UTIL_LOG_H 1
30
31
#ifdef HAVE_CONFIG_H
32
# include <config.h>
33
#endif
34
35
#ifdef HAVE_SYSLOG_H
36
# include <syslog.h>
37
#endif
38
39
#include "
pool.h
"
40
41
typedef
enum
{
42
log_STDOUT
,
43
log_SYSLOG
,
44
log_FILE
45
}
log_type_t
;
46
47
/* opaque decl */
48
typedef
struct
_log_st *
log_t
;
49
50
JABBERD2_API
log_t
log_new
(
pool_t
p,
log_type_t
type,
const
char
*ident,
const
char
*facility);
51
JABBERD2_API
void
log_write
(
log_t
log,
int
level,
const
char
*msgfmt, ...);
52
53
/* debug logging */
54
#if defined(DEBUG) && 0
55
JABBERD2_API
int
log_debug_flag;
56
void
log_debug
(
char
*file,
int
line,
const
char
*subsys,
const
char
*msgfmt, ...);
57
58
# define log_debug_get_flag() log_debug_flag
59
# define log_debug_set_flag(f) (log_debug_flag = f ? 1 : 0)
60
# define log_debug(...) if(log_debug_flag) __log_debug(__FILE__,__LINE__,0,__VA_ARGS__)
61
# define log_debug_subsys(...) if(log_debug_flag) __log_debug(__FILE__,__LINE__,__VA_ARGS__)
62
#else
63
# define log_debug_get_flag() (0)
64
# define log_debug_set_flag(f)
65
# define log_debug(...)
66
# define log_debug_subsys(...)
67
#endif
68
69
#endif
pool.h
JABBERD2_API
#define JABBERD2_API
Definition:
mio.h:39
log_STDOUT
Definition:
log.h:42
log_t
struct _log_st * log_t
Definition:
log.h:48
log_type_t
log_type_t
Definition:
log.h:41
log_new
JABBERD2_API log_t log_new(pool_t p, log_type_t type, const char *ident, const char *facility)
log_debug
#define log_debug(...)
Definition:
log.h:65
log_SYSLOG
Definition:
log.h:43
log_FILE
Definition:
log.h:44
pool_struct
pool - base node for a pool.
Definition:
pool.h:80
log_write
JABBERD2_API void log_write(log_t log, int level, const char *msgfmt,...)
Definition:
log.c:104
Generated by
1.8.10