2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 21:17:54 +00:00

190 Commits

Author SHA1 Message Date
Andreas Gustafsson
4532e9e7c6 in isc_log_wouldlog(), deal with the possibility of lctx
being NULL
2000-07-13 02:28:18 +00:00
Andreas Gustafsson
30576c592b 330. [func] New function isc_log_wouldlog(). 2000-07-13 00:19:02 +00:00
David Lawrence
c244584cad 276. [bug] isc_log_categorybyname() and isc_log_modulebyname()
would fail to find the first member of any category
                        or module array apart from the internal defaults.
                        Thus, for example, the "notify" category was improperly
                        configured by named.

This resolves RT #132, "Logging channels definition problems."
2000-06-23 17:52:20 +00:00
Brian Wellington
ac37a32d23 If isc_log_settag() was used to set a non-NULL tag, the allocated memory
was never freed.
2000-06-02 18:15:45 +00:00
David Lawrence
87cafc5e70 Megacommit of many files.
Mostly, several functions that take pointers as arguments, almost
always char * pointers, had those pointers qualified with "const".
Those that returned pointers to previously const-qualified arguments
had their return values qualified as const.  Some structure members
were qualified as const to retain that attribute from the variables
from which they were assigned.

The macro DE_CONST was added to isc/util.h to deal with a handful of very
special places where something is qualified as const but really needs to have
its const qualifier removed.

Also cleaned up a few places where variable names clashed with reserved
identifiers.  (Which mostly works fine, but strictly speaking is undefined
by the standard.)

Minor other ISC style cleanups.
2000-06-01 17:20:56 +00:00
David Lawrence
389b5c8593 added a sync_channellist call to isc_log_create to ensure the channellist in
the logconfig is properly dimensioned, and only free the channellist
memory in isc_logconfig_destroy if the channellist_count is > 0.
the first addresses a problem that could occur when a successful
isc_log_create was followed immediately by isc_log_[v]write[1] or
isc_log_destroy (with no intervening isc_log_usechannel or
isc_logconfig_use), and the second addresses a problem that could
occur in cleanup if isc_log_create or isc_logconfig_create failed.
2000-05-24 02:33:16 +00:00
David Lawrence
76b4bfdf32 minor assertion check shuffling 2000-05-18 22:38:49 +00:00
Brian Wellington
a375150af2 REQUIRE() checking in isc_log_doit could seg fault 2000-05-18 17:56:35 +00:00
David Lawrence
75a44b91a9 isc_time_subtract() now returns isc_result_t.
Use isc_time_secondsastimet() to set a time_t variable.

Properly skip the duplicate checking loop if the boundary time is not
successfully set (this was intended before, but coded wrongly).

Removed unused variable pid_string, after I opted to not add the
unrequested ISC_LOG_PRINTPID option half way into implementing it.
2000-05-18 17:20:15 +00:00
David Lawrence
2918b5bda6 ISC_LOG_PRINTTAG/isc_log_settag()/isc_log_gettag() added 2000-05-16 03:37:39 +00:00
David Lawrence
1a69a1a78c Megacommit of dozens of files.
Cleanup of redundant/useless header file inclusion.

ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
   /*
    * This is a comment.
    */
2000-05-08 14:38:29 +00:00
Michael Graff
1a487fb7d2 Add isc_log_setcontext() to set the isc_lctx global (ala dns_lctx) and add module names for isc/socket 2000-05-03 21:09:34 +00:00
Michael Graff
2d3a9eee3f namespace protection via 'static' 2000-04-28 17:29:25 +00:00
David Lawrence
6b7257f756 include config.h 2000-04-28 02:08:20 +00:00
David Lawrence
a9cb032d07 comparison of channel->type to NULL should have been to ISC_LOG_TONULL 2000-04-11 18:22:34 +00:00
David Lawrence
e6a6c0a5d6 35. [performance] Log messages which are of a level too high to be
logged by any channel in the logging configuration
                        will not cause the log mutex to be locked.
2000-04-06 20:32:31 +00:00
Andreas Gustafsson
5fe5a0c026 revised logging categories 2000-03-23 00:55:12 +00:00
Andreas Gustafsson
d132769ee8 the syslog facility for the default_syslog channel is
LOG_DAEMON, not LOG_INFO
2000-03-23 00:49:15 +00:00
Bob Halley
4dcfb5fb22 lint 2000-03-14 19:27:55 +00:00
David Lawrence
912ccd2554 include milliseconds when doing ISC_LOG_PRINTTIME 2000-03-10 17:53:16 +00:00
David Lawrence
1be10d46cb require name != NULL in *byname 2000-03-04 16:41:14 +00:00
David Lawrence
ff30a206ec added isc_log_categorybyname and isc_log_modulebyname 2000-03-04 00:43:40 +00:00
Andreas Gustafsson
1620f03517 don't set ISC_LOG_DEBUGONLY on the default_debug channel 2000-03-01 20:38:58 +00:00
David Lawrence
a40cc3249f isc_logchannel, isc_logchannellist, and isc_logmessage now use the isc list
macros.

ISC_LOG_DEBUGONLY flag for a channel added, to mark a channel that should
only be used if the debugging level is non-zero.

Use ISC_LOG_DEBUGONLY for default_debug.

REQUIRE the context is valid for isc_logconfig_get, and ENSURE that
the configuration returned is non-NULL.

Other miscellaneous cleanups.
2000-03-01 17:31:56 +00:00
David Lawrence
edcd1247ad isc_log_create now has three parameters, the additional one used to
return an isc_logconfig_t.  isc_log_cretechannel and isc_log_usechannel
now take an isc_logconfig_t instead of an isc_log_t; this is to address
reconfiguration in a multithreaded environment.

isc_logconfig_create, isc_logconfig_get, isc_logconfig_use and
isc_logconfig_destroy were added to work with the new isc_logconfig_t type.

isc_logregister_categories and dns_log_init are now both void rather than
returning isc_result_t.
2000-02-26 19:57:02 +00:00
Bob Halley
ca41b452ed update copyrights 2000-02-03 23:08:31 +00:00
David Lawrence
0bd4e3591a reversing bogus checkin 2000-01-06 15:02:16 +00:00
David Lawrence
cc1b6f86f2 added ISC_RESULTCLASS_OMAPI 2000-01-06 14:47:39 +00:00
Mark Andrews
19c5c23ef6 fix compiler warning: While loop condition is always non-zero.
nxt_30.c enforce type range to 1..127. DNS_R_RANGE otherwise.
1999-11-03 01:07:02 +00:00
Bob Halley
8d43223900 isc_dir_open api change 1999-10-31 19:09:23 +00:00
David Lawrence
229f8a97f7 duplicate log message filtering functionality via isc_log_write1() and
isc_log_vwrite1(), configurable over X seconds using
isc_log_setduplicateinterval().

isc_log_vwrite renamed to static isc_log_doit(), isc_log_vwrite() created
as wrapper for isc_log_doit().

don't do a second test on ISC_LOG_PRINTLEVEL when logging the message to add
a colon-space, since the colon-space is already in level_string.

print "no_module: " if a module has not been specified (but PRINTMODULE was),
to keep tokenization nice and clean for future log-file parsing programs
without looking quite like a bug, which is what happens with:
  Oct 25 15:51:07 dns_general: : notice: This should be in file 1/1
instead of
  Oct 25 15:51:07 dns_general: no_module: notice: This should be in file 1/1
1999-10-25 19:55:06 +00:00
Mark Andrews
8cdac11df1 Correct comment 1999-10-25 13:11:13 +00:00
Bob Halley
d409ceeda4 do not require ': ' in module/category names 1999-10-22 19:30:38 +00:00
James Brister
59c6f0e26b If logging context is NULL in isc_log_vwrite(), then bail before
doing any REQUIREs that require it being non-NULL.
1999-10-15 19:04:38 +00:00
David Lawrence
7046378cf8 include isc/print.h for vsnprintf 1999-10-11 16:10:06 +00:00
David Lawrence
135808ceb1 use vsnprintf, now portable because of isc/print.c.
removed static forward declaration of isc_log_vwrite(), now public.
declared assignchannel() as static.
1999-10-11 14:50:51 +00:00
David Lawrence
6ffc076c08 isc_log_vwrite is now a public function 1999-10-11 13:28:49 +00:00
David Lawrence
eac339874d no more unistd.h; use remove() from stdio rather than unlink() 1999-10-07 02:10:10 +00:00
David Lawrence
72c99dbd09 no longer needs dirent.h 1999-09-30 22:14:53 +00:00
David Lawrence
fc80027fb5 logging interface & test program. not yet NT portable because of syslog. 1999-09-23 17:43:51 +00:00