xref: /netbsd/external/bsd/libbind/dist/isc/logging_p.h (revision 6550d01e)
1 /*	$NetBSD: logging_p.h,v 1.1.1.1 2009/04/12 15:33:45 christos Exp $	*/
2 
3 /*
4  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
5  * Copyright (c) 1996-1999 by Internet Software Consortium.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
17  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef LOGGING_P_H
21 #define LOGGING_P_H
22 
23 typedef struct log_file_desc {
24 	char *name;
25 	size_t name_size;
26 	FILE *stream;
27 	unsigned int versions;
28 	unsigned long max_size;
29 	uid_t owner;
30 	gid_t group;
31 } log_file_desc;
32 
33 typedef union log_output {
34 	int facility;
35 	log_file_desc file;
36 } log_output;
37 
38 struct log_channel {
39 	int level;			/*%< don't log messages > level */
40 	log_channel_type type;
41 	log_output out;
42 	unsigned int flags;
43 	int references;
44 };
45 
46 typedef struct log_channel_list {
47 	log_channel channel;
48 	struct log_channel_list *next;
49 } *log_channel_list;
50 
51 #define LOG_BUFFER_SIZE 20480
52 
53 struct log_context {
54 	int num_categories;
55 	char **category_names;
56 	log_channel_list *categories;
57 	int flags;
58 	int level;
59 	char buffer[LOG_BUFFER_SIZE];
60 };
61 
62 #endif /* !LOGGING_P_H */
63 /*! \file */
64