mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
added isccfg log modules and categories
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: Makefile.in,v 1.1 2001/02/15 04:14:12 gson Exp $
|
||||
# $Id: Makefile.in,v 1.2 2001/02/22 02:38:22 gson Exp $
|
||||
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
@@ -41,10 +41,10 @@ LIBS = @LIBS@
|
||||
SUBDIRS = include
|
||||
|
||||
# Alphabetically
|
||||
OBJS = parser.@O@
|
||||
OBJS = parser.@O@ log.@O@
|
||||
|
||||
# Alphabetically
|
||||
SRCS = parser.c
|
||||
SRCS = parser.c log.c
|
||||
|
||||
TARGETS = timestamp
|
||||
|
||||
|
53
lib/isccfg/include/isccfg/log.h
Normal file
53
lib/isccfg/include/isccfg/log.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: log.h,v 1.1 2001/02/22 02:38:25 gson Exp $ */
|
||||
|
||||
#ifndef ISCCFG_LOG_H
|
||||
#define ISCCFG_LOG_H 1
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/log.h>
|
||||
|
||||
extern isc_logcategory_t isccfg_categories[];
|
||||
extern isc_logmodule_t isccfg_modules[];
|
||||
|
||||
#define ISCCFG_LOGCATEGORY_CONFIG (&isccfg_categories[0])
|
||||
|
||||
#define ISCCFG_LOGMODULE_PARSER (&isccfg_modules[0])
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
void
|
||||
isccfg_log_init(isc_log_t *lctx);
|
||||
/*
|
||||
* Make the libisccfg categories and modules available for use with the
|
||||
* ISC logging library.
|
||||
*
|
||||
* Requires:
|
||||
* lctx is a valid logging context.
|
||||
*
|
||||
* isccfg_log_init() is called only once.
|
||||
*
|
||||
* Ensures:
|
||||
* The catgories and modules defined above are available for
|
||||
* use by isc_log_usechannnel() and isc_log_write().
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
#endif /* DNS_LOG_H */
|
50
lib/isccfg/log.c
Normal file
50
lib/isccfg/log.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2001 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: log.c,v 1.1 2001/02/22 02:38:23 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <isccfg/log.h>
|
||||
|
||||
/*
|
||||
* When adding a new category, be sure to add the appropriate
|
||||
* #define to <isccfg/log.h>.
|
||||
*/
|
||||
isc_logcategory_t isccfg_categories[] = {
|
||||
{ "config", 0 },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
/*
|
||||
* When adding a new module, be sure to add the appropriate
|
||||
* #define to <isccfg/log.h>.
|
||||
*/
|
||||
isc_logmodule_t isccfg_modules[] = {
|
||||
{ "isccfg/parser", 0 },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
void
|
||||
isccfg_log_init(isc_log_t *lctx) {
|
||||
REQUIRE(lctx != NULL);
|
||||
|
||||
isc_log_registercategories(lctx, isccfg_categories);
|
||||
isc_log_registermodules(lctx, isccfg_modules);
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: parser.c,v 1.13 2001/02/22 01:40:51 bwelling Exp $ */
|
||||
/* $Id: parser.c,v 1.14 2001/02/22 02:38:23 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
#include <isc/symtab.h>
|
||||
|
||||
#include <isccfg/cfg.h>
|
||||
#include <isccfg/log.h>
|
||||
|
||||
/* XXX create a <cfg/log.h> file and a corresponding .c file */
|
||||
|
||||
#define CAT ISC_LOGCATEGORY_GENERAL
|
||||
#define MOD ISC_LOGMODULE_SOCKET /* XXX */
|
||||
/* Shorthand */
|
||||
#define CAT ISCCFG_LOGCATEGORY_CONFIG
|
||||
#define MOD ISCCFG_LOGMODULE_PARSER
|
||||
|
||||
/*
|
||||
* Pass one of these flags to parser_error() to include the
|
||||
|
@@ -1319,12 +1319,14 @@
|
||||
./lib/isccfg/.cvsignore X 2001
|
||||
./lib/isccfg/Makefile.in C 2001
|
||||
./lib/isccfg/api C 2001
|
||||
./lib/isccfg/log.c C 2001
|
||||
./lib/isccfg/parser.c C 2000,2001
|
||||
./lib/isccfg/include/.cvsignore C 2001
|
||||
./lib/isccfg/include/Makefile.in C 2001
|
||||
./lib/isccfg/include/isccfg/.cvsignore C 2001
|
||||
./lib/isccfg/include/isccfg/Makefile.in C 2001
|
||||
./lib/isccfg/include/isccfg/cfg.h C 2000,2001
|
||||
./lib/isccfg/include/isccfg/log.h C 2001
|
||||
./lib/lwres/.cvsignore X 2000,2001
|
||||
./lib/lwres/Makefile.in MAKE 2000,2001
|
||||
./lib/lwres/api X 2000,2001
|
||||
|
Reference in New Issue
Block a user