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
@@ -497,24 +497,25 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
* ISC_R_NOMEMORY Resource limit: Out of memory
*/
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 message,
const char *format, ...)
ISC_FORMAT_PRINTF(8, 9);
void
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_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.
@@ -544,20 +545,18 @@ ISC_FORMAT_PRINTF(5, 6);
* meaningful error.
*/
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 message,
const char *format, va_list args)
ISC_FORMAT_PRINTF(8, 0);
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 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_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.
*
@@ -591,40 +590,36 @@ ISC_FORMAT_PRINTF(5, 0);
* meaningful error.
*/
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 message,
const char *format, ...)
ISC_FORMAT_PRINTF(8, 9);
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 message,
const char *format, ...)
ISC_FORMAT_PRINTF(8, 9);
void
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).
* This function is otherwise identical to isc_log_write().
*/
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 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_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_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>
@@ -803,7 +801,7 @@ 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 msg,
const char *format, ...)
@@ -821,7 +819,7 @@ isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
}
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 msg,
const char *format, va_list args)
@@ -834,7 +832,7 @@ isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
}
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 msg,
const char *format, ...)
@@ -852,7 +850,7 @@ isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
}
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 msg,
const char *format, va_list args)
@@ -864,14 +862,8 @@ isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
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_log_write(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *format, ...)
{
va_list args;
@@ -887,7 +879,7 @@ isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
}
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)
{
@@ -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)
{