mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
263. [func] New logging channel type 'stderr'
channel some-name { stderr; severity error; }
This commit is contained in:
parent
fc20f8d409
commit
58c42ee18c
7
CHANGES
7
CHANGES
@ -1,3 +1,10 @@
|
||||
263. [func] New logging channel type 'stderr'
|
||||
|
||||
channel some-name {
|
||||
stderr;
|
||||
severity error;
|
||||
}
|
||||
|
||||
262. [bug] 'master' was not initalised in zone.c:stub_callback().
|
||||
|
||||
261. [func] Add dns_zone_markdirty().
|
||||
|
@ -393,6 +393,10 @@ logging {
|
||||
severity error;
|
||||
};
|
||||
|
||||
channel stderr_errors {
|
||||
stderr;
|
||||
};
|
||||
|
||||
/*
|
||||
* Channels have a severity level. Messages at severity levels
|
||||
* greater than or equal to the channel's level will be logged on
|
||||
|
@ -15,7 +15,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confctx.c,v 1.69 2000/06/15 23:38:12 brister Exp $ */
|
||||
/* $Id: confctx.c,v 1.70 2000/06/20 21:36:43 brister Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -1302,6 +1302,31 @@ dns_c_ctx_addnullchannel(dns_c_ctx_t *cfg, const char *name,
|
||||
}
|
||||
|
||||
|
||||
isc_result_t
|
||||
dns_c_ctx_addstderrchannel(dns_c_ctx_t *cfg, const char *name,
|
||||
dns_c_logchan_t **chan)
|
||||
{
|
||||
dns_c_logchan_t *newc;
|
||||
isc_result_t res;
|
||||
|
||||
REQUIRE(DNS_C_CONFCTX_VALID(cfg));
|
||||
REQUIRE(name != NULL);
|
||||
REQUIRE(chan != NULL);
|
||||
REQUIRE(cfg->logging != NULL);
|
||||
|
||||
res = dns_c_logchan_new(cfg->mem, name, dns_c_logchan_stderr, &newc);
|
||||
if (res != ISC_R_SUCCESS) {
|
||||
return (res);
|
||||
}
|
||||
|
||||
res = dns_c_logginglist_addchannel(cfg->logging, newc, ISC_FALSE);
|
||||
|
||||
*chan = newc;
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
|
||||
isc_result_t
|
||||
dns_c_ctx_addcategory(dns_c_ctx_t *cfg, const char *catname,
|
||||
dns_c_logcat_t **newcat)
|
||||
|
@ -15,7 +15,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: conflog.c,v 1.15 2000/05/08 18:42:38 brister Exp $ */
|
||||
/* $Id: conflog.c,v 1.16 2000/06/20 21:36:44 brister Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -515,6 +515,7 @@ dns_c_logchan_new(isc_mem_t *mem, const char *name,
|
||||
|
||||
case dns_c_logchan_syslog:
|
||||
case dns_c_logchan_null:
|
||||
case dns_c_logchan_stderr:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -544,6 +545,7 @@ dns_c_logchan_delete(dns_c_logchan_t **channel) {
|
||||
|
||||
case dns_c_logchan_syslog:
|
||||
case dns_c_logchan_null:
|
||||
case dns_c_logchan_stderr:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -590,6 +592,7 @@ dns_c_logchan_copy(isc_mem_t *mem, dns_c_logchan_t **dest,
|
||||
break;
|
||||
|
||||
case dns_c_logchan_null:
|
||||
case dns_c_logchan_stderr:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -643,6 +646,10 @@ dns_c_logchan_print(FILE *fp, int indent, dns_c_logchan_t *logchan,
|
||||
case dns_c_logchan_null:
|
||||
fputs("null", fp);
|
||||
break;
|
||||
|
||||
case dns_c_logchan_stderr:
|
||||
fputs("stderr", fp);
|
||||
break;
|
||||
}
|
||||
fprintf(fp, ";\n");
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confparser.y,v 1.97 2000/06/15 23:38:14 brister Exp $ */
|
||||
/* $Id: confparser.y,v 1.98 2000/06/20 21:36:45 brister Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -354,6 +354,7 @@ static isc_boolean_t int_too_big(isc_uint32_t base, isc_uint32_t mult);
|
||||
%token L_STACKSIZE
|
||||
%token L_STATS_FILE
|
||||
%token L_STATS_INTERVAL
|
||||
%token L_STDERR
|
||||
%token L_STUB
|
||||
%token L_SUBDOMAIN
|
||||
%token L_SUPPORT_IXFR
|
||||
@ -2178,6 +2179,23 @@ channel_stmt:
|
||||
|
||||
isc_mem_free(memctx, $2);
|
||||
} L_EOS optional_channel_opt_list L_RBRACE
|
||||
| L_CHANNEL channel_name L_LBRACE L_STDERR {
|
||||
dns_c_logchan_t *newc;
|
||||
|
||||
tmpres = dns_c_ctx_addstderrchannel(currcfg,
|
||||
$2, &newc);
|
||||
if (tmpres == ISC_R_EXISTS) {
|
||||
parser_error(ISC_FALSE,
|
||||
"cannot redefine channel %s", $2);
|
||||
YYABORT;
|
||||
} else if (tmpres != ISC_R_SUCCESS) {
|
||||
parser_error(ISC_FALSE,
|
||||
"failed to add new channel '%s'", $2);
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
isc_mem_free(memctx, $2);
|
||||
} L_EOS optional_channel_opt_list L_RBRACE
|
||||
| L_CHANNEL channel_name L_LBRACE logging_non_type_keywords {
|
||||
parser_error(ISC_FALSE,
|
||||
"first statment inside a channel definition "
|
||||
@ -5181,6 +5199,7 @@ static struct token keyword_tokens [] = {
|
||||
{ "stacksize", L_STACKSIZE },
|
||||
{ "statistics-file", L_STATS_FILE },
|
||||
{ "statistics-interval", L_STATS_INTERVAL },
|
||||
{ "stderr", L_STDERR },
|
||||
{ "stub", L_STUB },
|
||||
{ "support-ixfr", L_SUPPORT_IXFR },
|
||||
{ "syslog", L_SYSLOG },
|
||||
|
@ -160,7 +160,8 @@ typedef enum {
|
||||
typedef enum {
|
||||
dns_c_logchan_file,
|
||||
dns_c_logchan_syslog,
|
||||
dns_c_logchan_null
|
||||
dns_c_logchan_null,
|
||||
dns_c_logchan_stderr
|
||||
} dns_c_logchantype_t;
|
||||
|
||||
|
||||
|
@ -251,6 +251,8 @@ isc_result_t dns_c_ctx_addsyslogchannel(dns_c_ctx_t *cfg, const char *name,
|
||||
dns_c_logchan_t **chan);
|
||||
isc_result_t dns_c_ctx_addnullchannel(dns_c_ctx_t *cfg, const char *name,
|
||||
dns_c_logchan_t **chan);
|
||||
isc_result_t dns_c_ctx_addstderrchannel(dns_c_ctx_t *cfg, const char *name,
|
||||
dns_c_logchan_t **chan);
|
||||
|
||||
isc_result_t dns_c_ctx_addcategory(dns_c_ctx_t *cfg, const char *catname,
|
||||
dns_c_logcat_t **newcat);
|
||||
|
Loading…
x
Reference in New Issue
Block a user