mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 18:52:07 -04:00
do not require ': ' in module/category names
This commit is contained in:
parent
a385f150bb
commit
d409ceeda4
2 changed files with 20 additions and 17 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: log.h,v 1.3 1999/10/11 14:12:31 tale Exp $ */
|
||||
/* $Id: log.h,v 1.4 1999/10/22 19:30:38 halley Exp $ */
|
||||
|
||||
#ifndef ISC_LOG_H
|
||||
#define ISC_LOG_H 1
|
||||
|
|
@ -78,9 +78,7 @@ typedef struct isc_log isc_log_t;
|
|||
/*
|
||||
* Used to name the categories used by a library. An array of isc_logcategory
|
||||
* structures names each category, and the id value is initialized by calling
|
||||
* isc_log_registercategories. Each name should end in a colon-space pair
|
||||
* (": ") because it is used directly in the format string when
|
||||
* ISC_LOG_PRINTCATEGORY is enabled for a channel.
|
||||
* isc_log_registercategories.
|
||||
*/
|
||||
typedef struct isc_logcategory {
|
||||
const char *name;
|
||||
|
|
@ -195,10 +193,6 @@ isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]);
|
|||
* Notes:
|
||||
* The end of the categories array is identified by a NULL name.
|
||||
*
|
||||
* The name within each structure of categories[] should end in a
|
||||
* colon-space (": ") pair because its value is used to format the
|
||||
* log message when ISC_LOG_PRINTCATEGORY is set for a channel.
|
||||
*
|
||||
* Because the name is used by ISC_LOG_PRINTCATEGORY, it should not
|
||||
* be altered or destroyed after isc_log_registercategories().
|
||||
*
|
||||
|
|
@ -238,10 +232,6 @@ isc_log_registermodules(isc_log_t *lctx, isc_logmodule_t modules[]);
|
|||
* Notes:
|
||||
* The end of the modules array is identified by a NULL name.
|
||||
*
|
||||
* The name within each structure of modules[] should end in a
|
||||
* colon-space (": ") pair because its value is used to format the
|
||||
* log message when ISC_LOG_PRINTMODULE is set for a channel.
|
||||
*
|
||||
* Because the name is used by ISC_LOG_PRINTMODULE, it should not
|
||||
* be altered or destroyed after isc_log_registermodules().
|
||||
*
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: log.c,v 1.7 1999/10/15 19:04:38 brister Exp $ */
|
||||
/* $Id: log.c,v 1.8 1999/10/22 19:29:24 halley Exp $ */
|
||||
|
||||
/* Principal Authors: DCL */
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ static const int syslog_map[] = {
|
|||
* channellist in the log context, it must come first in isc_categories[].
|
||||
*/
|
||||
isc_logcategory_t isc_categories[] = {
|
||||
{ "default: ", 0 }, /* "default" must come first. */
|
||||
{ "default", 0 }, /* "default" must come first. */
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
|
|
@ -866,15 +866,22 @@ isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
|
|||
/* FALLTHROUGH */
|
||||
|
||||
case ISC_LOG_TOFILEDESC:
|
||||
fprintf(FILE_STREAM(channel), "%s%s%s%s%s\n",
|
||||
fprintf(FILE_STREAM(channel), "%s%s%s%s%s%s%s%s\n",
|
||||
(channel->flags & ISC_LOG_PRINTTIME) ?
|
||||
time_string : "",
|
||||
(channel->flags & ISC_LOG_PRINTCATEGORY) ?
|
||||
category->name : "",
|
||||
(channel->flags & ISC_LOG_PRINTCATEGORY) ?
|
||||
": " : "",
|
||||
(channel->flags & ISC_LOG_PRINTMODULE) ?
|
||||
module->name : "",
|
||||
(module != NULL ? module->name : "")
|
||||
: "",
|
||||
(channel->flags & ISC_LOG_PRINTMODULE) ?
|
||||
": " : "",
|
||||
(channel->flags & ISC_LOG_PRINTLEVEL) ?
|
||||
level_string : "",
|
||||
(channel->flags & ISC_LOG_PRINTLEVEL) ?
|
||||
": " : "",
|
||||
lctx->buffer);
|
||||
|
||||
fflush(FILE_STREAM(channel));
|
||||
|
|
@ -908,16 +915,22 @@ isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
|
|||
syslog_level = syslog_map[-level];
|
||||
|
||||
syslog(FACILITY(channel) | syslog_level,
|
||||
"%s%s%s%s%s",
|
||||
"%s%s%s%s%s%s%s%s",
|
||||
(channel->flags & ISC_LOG_PRINTTIME) ?
|
||||
time_string : "",
|
||||
(channel->flags & ISC_LOG_PRINTCATEGORY) ?
|
||||
category->name : "",
|
||||
(channel->flags & ISC_LOG_PRINTCATEGORY) ?
|
||||
": " : "",
|
||||
(channel->flags & ISC_LOG_PRINTMODULE) ?
|
||||
(module != NULL ? module->name : "")
|
||||
: "",
|
||||
(channel->flags & ISC_LOG_PRINTMODULE) ?
|
||||
": " : "",
|
||||
(channel->flags & ISC_LOG_PRINTLEVEL) ?
|
||||
level_string : "",
|
||||
(channel->flags & ISC_LOG_PRINTLEVEL) ?
|
||||
": " : "",
|
||||
lctx->buffer);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue