isc_log Struct Reference


Data Fields

unsigned int magic
isc_mem_tmctx
isc_logcategory_tcategories
unsigned int category_count
isc_logmodule_tmodules
unsigned int module_count
int debug_level
isc_mutex_t lock
isc_logconfig_tlogconfig
char buffer [LOG_BUFFER_SIZE]

Detailed Description

This isc_log structure provides the context for the isc_log functions. The log context locks itself in isc_log_doit, the internal backend to isc_log_write. The locking is necessary both to provide exclusive access to the buffer into which the message is formatted and to guard against competing threads trying to write to the same syslog resource. (On some systems, such as BSD/OS, stdio is thread safe but syslog is not.) Unfortunately, the lock cannot guard against a _different_ logging context in the same program competing for syslog's attention. Thus There Can Be Only One, but this is not enforced. XXXDCL enforce it?

Note that the category and module information is not locked. This is because in the usual case, only one isc_log_t is ever created in a program, and the category/module registration happens only once. XXXDCL it might be wise to add more locking overall.

Definition at line 144 of file log.c.


Field Documentation

unsigned int isc_log::magic

Definition at line 146 of file log.c.

Referenced by isc_log_create(), and isc_log_destroy().

isc_mem_t* isc_log::mctx

Definition at line 147 of file log.c.

Referenced by assignchannel(), isc_log_create(), isc_log_createchannel(), isc_log_destroy(), isc_log_doit(), isc_log_settag(), isc_logconfig_create(), isc_logconfig_destroy(), and sync_channellist().

isc_logcategory_t* isc_log::categories

Definition at line 148 of file log.c.

Referenced by isc_log_categorybyname(), isc_log_create(), isc_log_destroy(), and isc_log_registercategories().

unsigned int isc_log::category_count

Definition at line 149 of file log.c.

Referenced by isc_log_create(), isc_log_destroy(), isc_log_doit(), isc_log_registercategories(), isc_log_usechannel(), and sync_channellist().

isc_logmodule_t* isc_log::modules

Definition at line 150 of file log.c.

Referenced by isc_log_create(), isc_log_destroy(), isc_log_modulebyname(), and isc_log_registermodules().

unsigned int isc_log::module_count

Definition at line 151 of file log.c.

Referenced by assignchannel(), isc_log_create(), isc_log_destroy(), isc_log_doit(), isc_log_registermodules(), and isc_log_usechannel().

int isc_log::debug_level

Definition at line 152 of file log.c.

Referenced by isc_log_create(), isc_log_destroy(), isc_log_doit(), isc_log_getdebuglevel(), and isc_log_setdebuglevel().

isc_mutex_t isc_log::lock

Definition at line 153 of file log.c.

Referenced by isc_log_closefilelogs(), isc_log_create(), isc_log_destroy(), isc_log_doit(), isc_log_setdebuglevel(), and isc_logconfig_use().

isc_logconfig_t* isc_log::logconfig

Definition at line 155 of file log.c.

Referenced by isc_log_closefilelogs(), isc_log_create(), isc_log_destroy(), isc_log_doit(), isc_log_setdebuglevel(), isc_log_wouldlog(), isc_logconfig_destroy(), isc_logconfig_get(), and isc_logconfig_use().

char isc_log::buffer[LOG_BUFFER_SIZE]

Definition at line 156 of file log.c.

Referenced by isc_log_destroy(), and isc_log_doit().


The documentation for this struct was generated from the following file:
Generated on Tue Apr 28 17:41:20 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha