2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 16:15:27 +00:00

use isc_log_iwrite() for localized logging,

to keep backwards compatibility
This commit is contained in:
Andreas Gustafsson
2000-12-12 00:18:01 +00:00
parent f8246fc026
commit fc6f5743aa
2 changed files with 41 additions and 54 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: log.h,v 1.32 2000/12/07 19:30:28 tale Exp $ */
/* $Id: log.h,v 1.33 2000/12/12 00:18:01 gson Exp $ */
#ifndef ISC_LOG_H
#define ISC_LOG_H 1
@@ -498,23 +498,24 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
*/
void
isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int message,
const char *format, ...)
ISC_FORMAT_PRINTF(8, 9);
void
isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
const char *format, ...)
ISC_FORMAT_PRINTF(5, 6);
#ifndef ISC_LOG_MSGCATARGS
#define isc_log_write isc_log_iwrite
#endif
/*
* Write a message to the log channels.
*
* Notes:
* Log message containing English text should be logged with
* isc_log_iwrite() to allow for localization.
*
* lctx can be NULL; this is allowed so that programs which use
* libraries that use the ISC logging system are not required to
* also use it.
@@ -545,19 +546,17 @@ ISC_FORMAT_PRINTF(5, 6);
*/
void
isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int message,
const char *format, va_list args)
ISC_FORMAT_PRINTF(8, 0);
void
isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
const char *format, va_list args)
ISC_FORMAT_PRINTF(5, 0);
#ifndef ISC_LOG_MSGCATARGS
#define isc_log_vwrite isc_log_ivwrite
#endif
/*
* Write a message to the log channels.
*
@@ -592,19 +591,17 @@ ISC_FORMAT_PRINTF(5, 0);
*/
void
isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int message,
const char *format, ...)
ISC_FORMAT_PRINTF(8, 9);
void
isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
const char *format, ...)
ISC_FORMAT_PRINTF(5, 6);
#ifndef ISC_LOG_MSGCATARGS
#define isc_log_write1 isc_log_iwrite1
#endif
/*
* Write a message to the log channels, pruning duplicates that occur within
* a configurable amount of seconds (see isc_log_[sg]etduplicateinterval).
@@ -612,19 +609,17 @@ ISC_FORMAT_PRINTF(5, 6);
*/
void
isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int message,
const char *format, va_list args)
ISC_FORMAT_PRINTF(8, 0);
void
isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format,
va_list args)
ISC_FORMAT_PRINTF(5, 0);
#ifndef ISC_LOG_MSGCATARGS
#define isc_log_vwrite1 isc_log_ivwrite1
#endif
/*
* Write a message to the log channels, pruning duplicates that occur within
* a configurable amount of seconds (see isc_log_[sg]etduplicateinterval).

View File

@@ -15,12 +15,10 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: log.c,v 1.52 2000/12/07 20:15:55 marka Exp $ */
/* $Id: log.c,v 1.53 2000/12/12 00:18:00 gson Exp $ */
/* Principal Authors: DCL */
#define ISC_LOG_MSGCATARGS
#include <config.h>
#include <errno.h>
@@ -802,77 +800,11 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
return (result);
}
void
isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int msg,
const char *format, ...)
{
va_list args;
/*
* Contract checking is done in isc_log_doit().
*/
va_start(args, format);
isc_log_doit(lctx, category, module, level, ISC_FALSE,
msgcat, msgset, msg, format, args);
va_end(args);
}
void
isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int msg,
const char *format, va_list args)
{
/*
* Contract checking is done in isc_log_doit().
*/
isc_log_doit(lctx, category, module, level, ISC_FALSE,
msgcat, msgset, msg, format, args);
}
void
isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int msg,
const char *format, ...)
{
va_list args;
/*
* Contract checking is done in isc_log_doit().
*/
va_start(args, format);
isc_log_doit(lctx, category, module, level, ISC_TRUE,
msgcat, msgset, msg, format, args);
va_end(args);
}
void
isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int msg,
const char *format, va_list args)
{
/*
* Contract checking is done in isc_log_doit().
*/
isc_log_doit(lctx, category, module, level, ISC_TRUE,
msgcat, msgset, msg, format, args);
}
/*
* The isc_log_i*write*() functions are transitional functions which will
* be removed once all users of the old isc_log_*write* APIs have been
* converted to the new form (which added msgcat, msgset and msg parameters).
* They are used unless the calling module has ISC_LOG_MSGCATARGS defined.
*/
void
isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format, ...)
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int msg,
const char *format, ...)
{
va_list args;
@@ -882,12 +814,72 @@ isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
va_start(args, format);
isc_log_doit(lctx, category, module, level, ISC_FALSE,
NULL, 0, 0, format, args);
msgcat, msgset, msg, format, args);
va_end(args);
}
void
isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int msg,
const char *format, va_list args)
{
/*
* Contract checking is done in isc_log_doit().
*/
isc_log_doit(lctx, category, module, level, ISC_FALSE,
msgcat, msgset, msg, format, args);
}
void
isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int msg,
const char *format, ...)
{
va_list args;
/*
* Contract checking is done in isc_log_doit().
*/
va_start(args, format);
isc_log_doit(lctx, category, module, level, ISC_TRUE,
msgcat, msgset, msg, format, args);
va_end(args);
}
void
isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
isc_msgcat_t *msgcat, int msgset, int msg,
const char *format, va_list args)
{
/*
* Contract checking is done in isc_log_doit().
*/
isc_log_doit(lctx, category, module, level, ISC_TRUE,
msgcat, msgset, msg, format, args);
}
void
isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format, ...)
{
va_list args;
/*
* Contract checking is done in isc_log_doit().
*/
va_start(args, format);
isc_log_doit(lctx, category, module, level, ISC_FALSE,
NULL, 0, 0, format, args);
va_end(args);
}
void
isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
const char *format, va_list args)
{
@@ -899,7 +891,7 @@ isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
}
void
isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format, ...)
{
va_list args;
@@ -915,7 +907,7 @@ isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
}
void
isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
const char *format, va_list args)
{