Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/isc
File: log.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
[11] Fix | Delete
#ifndef ISC_LOG_H
[12] Fix | Delete
#define ISC_LOG_H 1
[13] Fix | Delete
[14] Fix | Delete
/*! \file isc/log.h */
[15] Fix | Delete
[16] Fix | Delete
#include <stdbool.h>
[17] Fix | Delete
#include <stdio.h>
[18] Fix | Delete
#include <stdarg.h>
[19] Fix | Delete
#include <syslog.h> /* XXXDCL NT */
[20] Fix | Delete
[21] Fix | Delete
#include <isc/formatcheck.h>
[22] Fix | Delete
#include <isc/lang.h>
[23] Fix | Delete
#include <isc/platform.h>
[24] Fix | Delete
#include <isc/types.h>
[25] Fix | Delete
[26] Fix | Delete
/*@{*/
[27] Fix | Delete
/*!
[28] Fix | Delete
* \brief Severity levels, patterned after Unix's syslog levels.
[29] Fix | Delete
*
[30] Fix | Delete
*/
[31] Fix | Delete
#define ISC_LOG_DEBUG(level) (level)
[32] Fix | Delete
/*!
[33] Fix | Delete
* #ISC_LOG_DYNAMIC can only be used for defining channels with
[34] Fix | Delete
* isc_log_createchannel(), not to specify a level in isc_log_write().
[35] Fix | Delete
*/
[36] Fix | Delete
#define ISC_LOG_DYNAMIC 0
[37] Fix | Delete
#define ISC_LOG_INFO (-1)
[38] Fix | Delete
#define ISC_LOG_NOTICE (-2)
[39] Fix | Delete
#define ISC_LOG_WARNING (-3)
[40] Fix | Delete
#define ISC_LOG_ERROR (-4)
[41] Fix | Delete
#define ISC_LOG_CRITICAL (-5)
[42] Fix | Delete
/*@}*/
[43] Fix | Delete
[44] Fix | Delete
/*@{*/
[45] Fix | Delete
/*!
[46] Fix | Delete
* \brief Destinations.
[47] Fix | Delete
*/
[48] Fix | Delete
#define ISC_LOG_TONULL 1
[49] Fix | Delete
#define ISC_LOG_TOSYSLOG 2
[50] Fix | Delete
#define ISC_LOG_TOFILE 3
[51] Fix | Delete
#define ISC_LOG_TOFILEDESC 4
[52] Fix | Delete
/*@}*/
[53] Fix | Delete
[54] Fix | Delete
/*@{*/
[55] Fix | Delete
/*%
[56] Fix | Delete
* Channel flags.
[57] Fix | Delete
*/
[58] Fix | Delete
#define ISC_LOG_PRINTTIME 0x0001
[59] Fix | Delete
#define ISC_LOG_PRINTLEVEL 0x0002
[60] Fix | Delete
#define ISC_LOG_PRINTCATEGORY 0x0004
[61] Fix | Delete
#define ISC_LOG_PRINTMODULE 0x0008
[62] Fix | Delete
#define ISC_LOG_PRINTTAG 0x0010 /* tag and ":" */
[63] Fix | Delete
#define ISC_LOG_PRINTPREFIX 0x0020 /* tag only, no colon */
[64] Fix | Delete
#define ISC_LOG_PRINTALL 0x003F
[65] Fix | Delete
#define ISC_LOG_BUFFERED 0x0040
[66] Fix | Delete
#define ISC_LOG_DEBUGONLY 0x1000
[67] Fix | Delete
#define ISC_LOG_OPENERR 0x8000 /* internal */
[68] Fix | Delete
/*@}*/
[69] Fix | Delete
[70] Fix | Delete
/*@{*/
[71] Fix | Delete
/*!
[72] Fix | Delete
* \brief Other options.
[73] Fix | Delete
*
[74] Fix | Delete
* XXXDCL INFINITE doesn't yet work. Arguably it isn't needed, but
[75] Fix | Delete
* since I am intend to make large number of versions work efficiently,
[76] Fix | Delete
* INFINITE is going to be trivial to add to that.
[77] Fix | Delete
*/
[78] Fix | Delete
#define ISC_LOG_ROLLINFINITE (-1)
[79] Fix | Delete
#define ISC_LOG_ROLLNEVER (-2)
[80] Fix | Delete
/*@}*/
[81] Fix | Delete
[82] Fix | Delete
/*!
[83] Fix | Delete
* \brief Used to name the categories used by a library.
[84] Fix | Delete
*
[85] Fix | Delete
* An array of isc_logcategory
[86] Fix | Delete
* structures names each category, and the id value is initialized by calling
[87] Fix | Delete
* isc_log_registercategories.
[88] Fix | Delete
*/
[89] Fix | Delete
struct isc_logcategory {
[90] Fix | Delete
const char *name;
[91] Fix | Delete
unsigned int id;
[92] Fix | Delete
};
[93] Fix | Delete
[94] Fix | Delete
/*%
[95] Fix | Delete
* Similar to isc_logcategory, but for all the modules a library defines.
[96] Fix | Delete
*/
[97] Fix | Delete
struct isc_logmodule {
[98] Fix | Delete
const char *name;
[99] Fix | Delete
unsigned int id;
[100] Fix | Delete
};
[101] Fix | Delete
[102] Fix | Delete
/*%
[103] Fix | Delete
* The isc_logfile structure is initialized as part of an isc_logdestination
[104] Fix | Delete
* before calling isc_log_createchannel().
[105] Fix | Delete
*
[106] Fix | Delete
* When defining an #ISC_LOG_TOFILE
[107] Fix | Delete
* channel the name, versions and maximum_size should be set before calling
[108] Fix | Delete
* isc_log_createchannel(). To define an #ISC_LOG_TOFILEDESC channel set only
[109] Fix | Delete
* the stream before the call.
[110] Fix | Delete
*
[111] Fix | Delete
* Setting maximum_size to zero implies no maximum.
[112] Fix | Delete
*/
[113] Fix | Delete
typedef struct isc_logfile {
[114] Fix | Delete
FILE *stream; /*%< Initialized to NULL for #ISC_LOG_TOFILE. */
[115] Fix | Delete
const char *name; /*%< NULL for #ISC_LOG_TOFILEDESC. */
[116] Fix | Delete
int versions; /* >= 0, #ISC_LOG_ROLLNEVER, #ISC_LOG_ROLLINFINITE. */
[117] Fix | Delete
/*%
[118] Fix | Delete
* stdio's ftell is standardized to return a long, which may well not
[119] Fix | Delete
* be big enough for the largest file supportable by the operating
[120] Fix | Delete
* system (though it is _probably_ big enough for the largest log
[121] Fix | Delete
* anyone would want). st_size returned by fstat should be typedef'd
[122] Fix | Delete
* to a size large enough for the largest possible file on a system.
[123] Fix | Delete
*/
[124] Fix | Delete
isc_offset_t maximum_size;
[125] Fix | Delete
bool maximum_reached; /*%< Private. */
[126] Fix | Delete
} isc_logfile_t;
[127] Fix | Delete
[128] Fix | Delete
/*%
[129] Fix | Delete
* Passed to isc_log_createchannel to define the attributes of either
[130] Fix | Delete
* a stdio or a syslog log.
[131] Fix | Delete
*/
[132] Fix | Delete
typedef union isc_logdestination {
[133] Fix | Delete
isc_logfile_t file;
[134] Fix | Delete
int facility; /* XXXDCL NT */
[135] Fix | Delete
} isc_logdestination_t;
[136] Fix | Delete
[137] Fix | Delete
/*@{*/
[138] Fix | Delete
/*%
[139] Fix | Delete
* The built-in categories of libisc.
[140] Fix | Delete
*
[141] Fix | Delete
* Each library registering categories should provide library_LOGCATEGORY_name
[142] Fix | Delete
* definitions with indexes into its isc_logcategory structure corresponding to
[143] Fix | Delete
* the order of the names.
[144] Fix | Delete
*/
[145] Fix | Delete
LIBISC_EXTERNAL_DATA extern isc_logcategory_t isc_categories[];
[146] Fix | Delete
LIBISC_EXTERNAL_DATA extern isc_log_t *isc_lctx;
[147] Fix | Delete
LIBISC_EXTERNAL_DATA extern isc_logmodule_t isc_modules[];
[148] Fix | Delete
/*@}*/
[149] Fix | Delete
[150] Fix | Delete
/*@{*/
[151] Fix | Delete
/*%
[152] Fix | Delete
* Do not log directly to DEFAULT. Use another category. When in doubt,
[153] Fix | Delete
* use GENERAL.
[154] Fix | Delete
*/
[155] Fix | Delete
#define ISC_LOGCATEGORY_DEFAULT (&isc_categories[0])
[156] Fix | Delete
#define ISC_LOGCATEGORY_GENERAL (&isc_categories[1])
[157] Fix | Delete
/*@}*/
[158] Fix | Delete
[159] Fix | Delete
#define ISC_LOGMODULE_SOCKET (&isc_modules[0])
[160] Fix | Delete
#define ISC_LOGMODULE_TIME (&isc_modules[1])
[161] Fix | Delete
#define ISC_LOGMODULE_INTERFACE (&isc_modules[2])
[162] Fix | Delete
#define ISC_LOGMODULE_TIMER (&isc_modules[3])
[163] Fix | Delete
#define ISC_LOGMODULE_FILE (&isc_modules[4])
[164] Fix | Delete
#define ISC_LOGMODULE_OTHER (&isc_modules[5])
[165] Fix | Delete
[166] Fix | Delete
ISC_LANG_BEGINDECLS
[167] Fix | Delete
[168] Fix | Delete
isc_result_t
[169] Fix | Delete
isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp);
[170] Fix | Delete
/*%<
[171] Fix | Delete
* Establish a new logging context, with default channels.
[172] Fix | Delete
*
[173] Fix | Delete
* Notes:
[174] Fix | Delete
*\li isc_log_create() calls isc_logconfig_create(), so see its comment
[175] Fix | Delete
* below for more information.
[176] Fix | Delete
*
[177] Fix | Delete
* Requires:
[178] Fix | Delete
*\li mctx is a valid memory context.
[179] Fix | Delete
*\li lctxp is not null and *lctxp is null.
[180] Fix | Delete
*\li lcfgp is null or lcfgp is not null and *lcfgp is null.
[181] Fix | Delete
*
[182] Fix | Delete
* Ensures:
[183] Fix | Delete
*\li *lctxp will point to a valid logging context if all of the necessary
[184] Fix | Delete
* memory was allocated, or NULL otherwise.
[185] Fix | Delete
*\li *lcfgp will point to a valid logging configuration if all of the
[186] Fix | Delete
* necessary memory was allocated, or NULL otherwise.
[187] Fix | Delete
*\li On failure, no additional memory is allocated.
[188] Fix | Delete
*
[189] Fix | Delete
* Returns:
[190] Fix | Delete
*\li #ISC_R_SUCCESS Success
[191] Fix | Delete
*\li #ISC_R_NOMEMORY Resource limit: Out of memory
[192] Fix | Delete
*/
[193] Fix | Delete
[194] Fix | Delete
isc_result_t
[195] Fix | Delete
isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp);
[196] Fix | Delete
/*%<
[197] Fix | Delete
* Create the data structure that holds all of the configurable information
[198] Fix | Delete
* about where messages are actually supposed to be sent -- the information
[199] Fix | Delete
* that could changed based on some configuration file, as opposed to the
[200] Fix | Delete
* the category/module specification of isc_log_[v]write[1] that is compiled
[201] Fix | Delete
* into a program, or the debug_level which is dynamic state information.
[202] Fix | Delete
*
[203] Fix | Delete
* Notes:
[204] Fix | Delete
*\li It is necessary to specify the logging context the configuration
[205] Fix | Delete
* will be used with because the number of categories and modules
[206] Fix | Delete
* needs to be known in order to set the configuration. However,
[207] Fix | Delete
* the configuration is not used by the logging context until the
[208] Fix | Delete
* isc_logconfig_use function is called.
[209] Fix | Delete
*
[210] Fix | Delete
*\li The memory context used for operations that allocate memory for
[211] Fix | Delete
* the configuration is that of the logging context, as specified
[212] Fix | Delete
* in the isc_log_create call.
[213] Fix | Delete
*
[214] Fix | Delete
*\li Four default channels are established:
[215] Fix | Delete
*\verbatim
[216] Fix | Delete
* default_syslog
[217] Fix | Delete
* - log to syslog's daemon facility #ISC_LOG_INFO or higher
[218] Fix | Delete
* default_stderr
[219] Fix | Delete
* - log to stderr #ISC_LOG_INFO or higher
[220] Fix | Delete
* default_debug
[221] Fix | Delete
* - log to stderr #ISC_LOG_DEBUG dynamically
[222] Fix | Delete
* null
[223] Fix | Delete
* - log nothing
[224] Fix | Delete
*\endverbatim
[225] Fix | Delete
*
[226] Fix | Delete
* Requires:
[227] Fix | Delete
*\li lctx is a valid logging context.
[228] Fix | Delete
*\li lcftp is not null and *lcfgp is null.
[229] Fix | Delete
*
[230] Fix | Delete
* Ensures:
[231] Fix | Delete
*\li *lcfgp will point to a valid logging context if all of the necessary
[232] Fix | Delete
* memory was allocated, or NULL otherwise.
[233] Fix | Delete
*\li On failure, no additional memory is allocated.
[234] Fix | Delete
*
[235] Fix | Delete
* Returns:
[236] Fix | Delete
*\li #ISC_R_SUCCESS Success
[237] Fix | Delete
*\li #ISC_R_NOMEMORY Resource limit: Out of memory
[238] Fix | Delete
*/
[239] Fix | Delete
[240] Fix | Delete
isc_logconfig_t *
[241] Fix | Delete
isc_logconfig_get(isc_log_t *lctx);
[242] Fix | Delete
/*%<
[243] Fix | Delete
* Returns a pointer to the configuration currently in use by the log context.
[244] Fix | Delete
*
[245] Fix | Delete
* Requires:
[246] Fix | Delete
*\li lctx is a valid context.
[247] Fix | Delete
*
[248] Fix | Delete
* Ensures:
[249] Fix | Delete
*\li The configuration pointer is non-null.
[250] Fix | Delete
*
[251] Fix | Delete
* Returns:
[252] Fix | Delete
*\li The configuration pointer.
[253] Fix | Delete
*/
[254] Fix | Delete
[255] Fix | Delete
isc_result_t
[256] Fix | Delete
isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg);
[257] Fix | Delete
/*%<
[258] Fix | Delete
* Associate a new configuration with a logging context.
[259] Fix | Delete
*
[260] Fix | Delete
* Notes:
[261] Fix | Delete
*\li This is thread safe. The logging context will lock a mutex
[262] Fix | Delete
* before attempting to swap in the new configuration, and isc_log_doit
[263] Fix | Delete
* (the internal function used by all of isc_log_[v]write[1]) locks
[264] Fix | Delete
* the same lock for the duration of its use of the configuration.
[265] Fix | Delete
*
[266] Fix | Delete
* Requires:
[267] Fix | Delete
*\li lctx is a valid logging context.
[268] Fix | Delete
*\li lcfg is a valid logging configuration.
[269] Fix | Delete
*\li lctx is the same configuration given to isc_logconfig_create
[270] Fix | Delete
* when the configuration was created.
[271] Fix | Delete
*
[272] Fix | Delete
* Ensures:
[273] Fix | Delete
*\li Future calls to isc_log_write will use the new configuration.
[274] Fix | Delete
*
[275] Fix | Delete
* Returns:
[276] Fix | Delete
*\li #ISC_R_SUCCESS Success
[277] Fix | Delete
*\li #ISC_R_NOMEMORY Resource limit: Out of memory
[278] Fix | Delete
*/
[279] Fix | Delete
[280] Fix | Delete
void
[281] Fix | Delete
isc_log_destroy(isc_log_t **lctxp);
[282] Fix | Delete
/*%<
[283] Fix | Delete
* Deallocate the memory associated with a logging context.
[284] Fix | Delete
*
[285] Fix | Delete
* Requires:
[286] Fix | Delete
*\li *lctx is a valid logging context.
[287] Fix | Delete
*
[288] Fix | Delete
* Ensures:
[289] Fix | Delete
*\li All of the memory associated with the logging context is returned
[290] Fix | Delete
* to the free memory pool.
[291] Fix | Delete
*
[292] Fix | Delete
*\li Any open files are closed.
[293] Fix | Delete
*
[294] Fix | Delete
*\li The logging context is marked as invalid.
[295] Fix | Delete
*/
[296] Fix | Delete
[297] Fix | Delete
void
[298] Fix | Delete
isc_logconfig_destroy(isc_logconfig_t **lcfgp);
[299] Fix | Delete
/*%<
[300] Fix | Delete
* Destroy a logging configuration.
[301] Fix | Delete
*
[302] Fix | Delete
* Notes:
[303] Fix | Delete
*\li This function cannot be used directly with the return value of
[304] Fix | Delete
* isc_logconfig_get, because a logging context must always have
[305] Fix | Delete
* a valid configuration associated with it.
[306] Fix | Delete
*
[307] Fix | Delete
* Requires:
[308] Fix | Delete
*\li lcfgp is not null and *lcfgp is a valid logging configuration.
[309] Fix | Delete
*\li The logging configuration is not in use by an existing logging context.
[310] Fix | Delete
*
[311] Fix | Delete
* Ensures:
[312] Fix | Delete
*\li All memory allocated for the configuration is freed.
[313] Fix | Delete
*
[314] Fix | Delete
*\li The configuration is marked as invalid.
[315] Fix | Delete
*/
[316] Fix | Delete
[317] Fix | Delete
void
[318] Fix | Delete
isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]);
[319] Fix | Delete
/*%<
[320] Fix | Delete
* Identify logging categories a library will use.
[321] Fix | Delete
*
[322] Fix | Delete
* Notes:
[323] Fix | Delete
*\li A category should only be registered once, but no mechanism enforces
[324] Fix | Delete
* this rule.
[325] Fix | Delete
*
[326] Fix | Delete
*\li The end of the categories array is identified by a NULL name.
[327] Fix | Delete
*
[328] Fix | Delete
*\li Because the name is used by #ISC_LOG_PRINTCATEGORY, it should not
[329] Fix | Delete
* be altered or destroyed after isc_log_registercategories().
[330] Fix | Delete
*
[331] Fix | Delete
*\li Because each element of the categories array is used by
[332] Fix | Delete
* isc_log_categorybyname, it should not be altered or destroyed
[333] Fix | Delete
* after registration.
[334] Fix | Delete
*
[335] Fix | Delete
*\li The value of the id integer in each structure is overwritten
[336] Fix | Delete
* by this function, and so id need not be initialized to any particular
[337] Fix | Delete
* value prior to the function call.
[338] Fix | Delete
*
[339] Fix | Delete
*\li A subsequent call to isc_log_registercategories with the same
[340] Fix | Delete
* logging context (but new categories) will cause the last
[341] Fix | Delete
* element of the categories array from the prior call to have
[342] Fix | Delete
* its "name" member changed from NULL to point to the new
[343] Fix | Delete
* categories array, and its "id" member set to UINT_MAX.
[344] Fix | Delete
*
[345] Fix | Delete
* Requires:
[346] Fix | Delete
*\li lctx is a valid logging context.
[347] Fix | Delete
*\li categories != NULL.
[348] Fix | Delete
*\li categories[0].name != NULL.
[349] Fix | Delete
*
[350] Fix | Delete
* Ensures:
[351] Fix | Delete
* \li There are references to each category in the logging context,
[352] Fix | Delete
* so they can be used with isc_log_usechannel() and isc_log_write().
[353] Fix | Delete
*/
[354] Fix | Delete
[355] Fix | Delete
void
[356] Fix | Delete
isc_log_registermodules(isc_log_t *lctx, isc_logmodule_t modules[]);
[357] Fix | Delete
/*%<
[358] Fix | Delete
* Identify logging categories a library will use.
[359] Fix | Delete
*
[360] Fix | Delete
* Notes:
[361] Fix | Delete
*\li A module should only be registered once, but no mechanism enforces
[362] Fix | Delete
* this rule.
[363] Fix | Delete
*
[364] Fix | Delete
*\li The end of the modules array is identified by a NULL name.
[365] Fix | Delete
*
[366] Fix | Delete
*\li Because the name is used by #ISC_LOG_PRINTMODULE, it should not
[367] Fix | Delete
* be altered or destroyed after isc_log_registermodules().
[368] Fix | Delete
*
[369] Fix | Delete
*\li Because each element of the modules array is used by
[370] Fix | Delete
* isc_log_modulebyname, it should not be altered or destroyed
[371] Fix | Delete
* after registration.
[372] Fix | Delete
*
[373] Fix | Delete
*\li The value of the id integer in each structure is overwritten
[374] Fix | Delete
* by this function, and so id need not be initialized to any particular
[375] Fix | Delete
* value prior to the function call.
[376] Fix | Delete
*
[377] Fix | Delete
*\li A subsequent call to isc_log_registermodules with the same
[378] Fix | Delete
* logging context (but new modules) will cause the last
[379] Fix | Delete
* element of the modules array from the prior call to have
[380] Fix | Delete
* its "name" member changed from NULL to point to the new
[381] Fix | Delete
* modules array, and its "id" member set to UINT_MAX.
[382] Fix | Delete
*
[383] Fix | Delete
* Requires:
[384] Fix | Delete
*\li lctx is a valid logging context.
[385] Fix | Delete
*\li modules != NULL.
[386] Fix | Delete
*\li modules[0].name != NULL;
[387] Fix | Delete
*
[388] Fix | Delete
* Ensures:
[389] Fix | Delete
*\li Each module has a reference in the logging context, so they can be
[390] Fix | Delete
* used with isc_log_usechannel() and isc_log_write().
[391] Fix | Delete
*/
[392] Fix | Delete
[393] Fix | Delete
isc_result_t
[394] Fix | Delete
isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
[395] Fix | Delete
unsigned int type, int level,
[396] Fix | Delete
const isc_logdestination_t *destination,
[397] Fix | Delete
unsigned int flags);
[398] Fix | Delete
/*%<
[399] Fix | Delete
* Specify the parameters of a logging channel.
[400] Fix | Delete
*
[401] Fix | Delete
* Notes:
[402] Fix | Delete
*\li The name argument is copied to memory in the logging context, so
[403] Fix | Delete
* it can be altered or destroyed after isc_log_createchannel().
[404] Fix | Delete
*
[405] Fix | Delete
*\li Defining a very large number of channels will have a performance
[406] Fix | Delete
* impact on isc_log_usechannel(), since the names are searched
[407] Fix | Delete
* linearly until a match is made. This same issue does not affect
[408] Fix | Delete
* isc_log_write, however.
[409] Fix | Delete
*
[410] Fix | Delete
*\li Channel names can be redefined; this is primarily useful for programs
[411] Fix | Delete
* that want their own definition of default_syslog, default_debug
[412] Fix | Delete
* and default_stderr.
[413] Fix | Delete
*
[414] Fix | Delete
*\li Any channel that is redefined will not affect logging that was
[415] Fix | Delete
* already directed to its original definition, _except_ for the
[416] Fix | Delete
* default_stderr channel. This case is handled specially so that
[417] Fix | Delete
* the default logging category can be changed by redefining
[418] Fix | Delete
* default_stderr. (XXXDCL Though now that I think of it, the default
[419] Fix | Delete
* logging category can be changed with only one additional function
[420] Fix | Delete
* call by defining a new channel and then calling isc_log_usechannel()
[421] Fix | Delete
* for #ISC_LOGCATEGORY_DEFAULT.)
[422] Fix | Delete
*
[423] Fix | Delete
*\li Specifying #ISC_LOG_PRINTTIME or #ISC_LOG_PRINTTAG for syslog is
[424] Fix | Delete
* allowed, but probably not what you wanted to do.
[425] Fix | Delete
*
[426] Fix | Delete
* #ISC_LOG_DEBUGONLY will mark the channel as usable only when the
[427] Fix | Delete
* debug level of the logging context (see isc_log_setdebuglevel)
[428] Fix | Delete
* is non-zero.
[429] Fix | Delete
*
[430] Fix | Delete
* Requires:
[431] Fix | Delete
*\li lcfg is a valid logging configuration.
[432] Fix | Delete
*
[433] Fix | Delete
*\li name is not NULL.
[434] Fix | Delete
*
[435] Fix | Delete
*\li type is #ISC_LOG_TOSYSLOG, #ISC_LOG_TOFILE, #ISC_LOG_TOFILEDESC or
[436] Fix | Delete
* #ISC_LOG_TONULL.
[437] Fix | Delete
*
[438] Fix | Delete
*\li destination is not NULL unless type is #ISC_LOG_TONULL.
[439] Fix | Delete
*
[440] Fix | Delete
*\li level is >= #ISC_LOG_CRITICAL (the most negative logging level).
[441] Fix | Delete
*
[442] Fix | Delete
*\li flags does not include any bits aside from the ISC_LOG_PRINT* bits,
[443] Fix | Delete
* #ISC_LOG_DEBUGONLY or #ISC_LOG_BUFFERED.
[444] Fix | Delete
*
[445] Fix | Delete
* Ensures:
[446] Fix | Delete
*\li #ISC_R_SUCCESS
[447] Fix | Delete
* A channel with the given name is usable with
[448] Fix | Delete
* isc_log_usechannel().
[449] Fix | Delete
*
[450] Fix | Delete
*\li #ISC_R_NOMEMORY or #ISC_R_UNEXPECTED
[451] Fix | Delete
* No additional memory is being used by the logging context.
[452] Fix | Delete
* Any channel that previously existed with the given name
[453] Fix | Delete
* is not redefined.
[454] Fix | Delete
*
[455] Fix | Delete
* Returns:
[456] Fix | Delete
*\li #ISC_R_SUCCESS Success
[457] Fix | Delete
*\li #ISC_R_NOMEMORY Resource limit: Out of memory
[458] Fix | Delete
*\li #ISC_R_UNEXPECTED type was out of range and REQUIRE()
[459] Fix | Delete
* was disabled.
[460] Fix | Delete
*/
[461] Fix | Delete
[462] Fix | Delete
isc_result_t
[463] Fix | Delete
isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
[464] Fix | Delete
const isc_logcategory_t *category,
[465] Fix | Delete
const isc_logmodule_t *module);
[466] Fix | Delete
/*%<
[467] Fix | Delete
* Associate a named logging channel with a category and module that
[468] Fix | Delete
* will use it.
[469] Fix | Delete
*
[470] Fix | Delete
* Notes:
[471] Fix | Delete
*\li The name is searched for linearly in the set of known channel names
[472] Fix | Delete
* until a match is found. (Note the performance impact of a very large
[473] Fix | Delete
* number of named channels.) When multiple channels of the same
[474] Fix | Delete
* name are defined, the most recent definition is found.
[475] Fix | Delete
*
[476] Fix | Delete
*\li Specifying a very large number of channels for a category will have
[477] Fix | Delete
* a moderate impact on performance in isc_log_write(), as each
[478] Fix | Delete
* call looks up the category for the start of a linked list, which
[479] Fix | Delete
* it follows all the way to the end to find matching modules. The
[480] Fix | Delete
* test for matching modules is integral, though.
[481] Fix | Delete
*
[482] Fix | Delete
*\li If category is NULL, then the channel is associated with the indicated
[483] Fix | Delete
* module for all known categories (including the "default" category).
[484] Fix | Delete
*
[485] Fix | Delete
*\li If module is NULL, then the channel is associated with every module
[486] Fix | Delete
* that uses that category.
[487] Fix | Delete
*
[488] Fix | Delete
*\li Passing both category and module as NULL would make every log message
[489] Fix | Delete
* use the indicated channel.
[490] Fix | Delete
*
[491] Fix | Delete
* \li Specifying a channel that is #ISC_LOG_TONULL for a category/module pair
[492] Fix | Delete
* has no effect on any other channels associated with that pair,
[493] Fix | Delete
* regardless of ordering. Thus you cannot use it to "mask out" one
[494] Fix | Delete
* category/module pair when you have specified some other channel that
[495] Fix | Delete
* is also used by that category/module pair.
[496] Fix | Delete
*
[497] Fix | Delete
* Requires:
[498] Fix | Delete
*\li lcfg is a valid logging configuration.
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function