"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/ns/log.c" (4 Sep 2020, 1514 Bytes) of package /linux/misc/dns/bind9/9.16.7/bind-9.16.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "log.c" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 /*! \file */
   13 
   14 #include <isc/result.h>
   15 #include <isc/util.h>
   16 
   17 #include <ns/log.h>
   18 
   19 #ifndef ISC_FACILITY
   20 #define ISC_FACILITY LOG_DAEMON
   21 #endif /* ifndef ISC_FACILITY */
   22 
   23 /*%
   24  * When adding a new category, be sure to add the appropriate
   25  * \#define to <ns/log.h>
   26  */
   27 LIBNS_EXTERNAL_DATA isc_logcategory_t ns_categories[] = {
   28     { "client", 0 },
   29     { "network", 0 },
   30     { "update", 0 },
   31     { "queries", 0 },
   32     { "update-security", 0 },
   33     { "query-errors", 0 },
   34     { "trust-anchor-telemetry", 0 },
   35     { "serve-stale", 0 },
   36     { NULL, 0 }
   37 };
   38 
   39 /*%
   40  * When adding a new module, be sure to add the appropriate
   41  * \#define to <ns/log.h>.
   42  */
   43 LIBNS_EXTERNAL_DATA isc_logmodule_t ns_modules[] = {
   44     { "ns/client", 0 }, { "ns/query", 0 },   { "ns/interfacemgr", 0 },
   45     { "ns/update", 0 }, { "ns/xfer-in", 0 }, { "ns/xfer-out", 0 },
   46     { "ns/notify", 0 }, { "ns/hooks", 0 },   { NULL, 0 }
   47 };
   48 
   49 LIBNS_EXTERNAL_DATA isc_log_t *ns_lctx = NULL;
   50 
   51 void
   52 ns_log_init(isc_log_t *lctx) {
   53     REQUIRE(lctx != NULL);
   54 
   55     isc_log_registercategories(lctx, ns_categories);
   56     isc_log_registermodules(lctx, ns_modules);
   57 }
   58 
   59 void
   60 ns_log_setcontext(isc_log_t *lctx) {
   61     ns_lctx = lctx;
   62 }