Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / bind / dist / lib / dns / log.c
blob468417c54bad692251649e0e00c4ac0227514ff0
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
7 * Permission to use, copy, modify, and/or 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.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
20 /* Id: log.c,v 1.45 2007/06/18 23:47:40 tbox Exp */
22 /*! \file */
24 /* Principal Authors: DCL */
26 #include <config.h>
28 #include <isc/util.h>
30 #include <dns/log.h>
32 /*%
33 * When adding a new category, be sure to add the appropriate
34 * \#define to <dns/log.h>.
36 LIBDNS_EXTERNAL_DATA isc_logcategory_t dns_categories[] = {
37 { "notify", 0 },
38 { "database", 0 },
39 { "security", 0 },
40 { "_placeholder", 0 },
41 { "dnssec", 0 },
42 { "resolver", 0 },
43 { "xfer-in", 0 },
44 { "xfer-out", 0 },
45 { "dispatch", 0 },
46 { "lame-servers", 0 },
47 { "delegation-only", 0 },
48 { "edns-disabled", 0 },
49 { NULL, 0 }
52 /*%
53 * When adding a new module, be sure to add the appropriate
54 * \#define to <dns/log.h>.
56 LIBDNS_EXTERNAL_DATA isc_logmodule_t dns_modules[] = {
57 { "dns/db", 0 },
58 { "dns/rbtdb", 0 },
59 { "dns/rbtdb64", 0 },
60 { "dns/rbt", 0 },
61 { "dns/rdata", 0 },
62 { "dns/master", 0 },
63 { "dns/message", 0 },
64 { "dns/cache", 0 },
65 { "dns/config", 0 },
66 { "dns/resolver", 0 },
67 { "dns/zone", 0 },
68 { "dns/journal", 0 },
69 { "dns/adb", 0 },
70 { "dns/xfrin", 0 },
71 { "dns/xfrout", 0 },
72 { "dns/acl", 0 },
73 { "dns/validator", 0 },
74 { "dns/dispatch", 0 },
75 { "dns/request", 0 },
76 { "dns/masterdump", 0 },
77 { "dns/tsig", 0 },
78 { "dns/tkey", 0 },
79 { "dns/sdb", 0 },
80 { "dns/diff", 0 },
81 { "dns/hints", 0 },
82 { "dns/acache", 0 },
83 { "dns/dlz", 0 },
84 { NULL, 0 }
87 LIBDNS_EXTERNAL_DATA isc_log_t *dns_lctx = NULL;
89 void
90 dns_log_init(isc_log_t *lctx) {
91 REQUIRE(lctx != NULL);
93 isc_log_registercategories(lctx, dns_categories);
94 isc_log_registermodules(lctx, dns_modules);
97 void
98 dns_log_setcontext(isc_log_t *lctx) {
99 dns_lctx = lctx;