From: Erez Zadok Date: Mon, 15 Aug 2005 01:54:49 +0000 (+0000) Subject: * libamu/xutil.c (xlog_opt): define new pseudo log_option named X-Git-Tag: before-clocktime-fixes~27 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=68cd9564a4fdba8fedb4648cbade23eb30318c96;p=am-utils-6.0.git * libamu/xutil.c (xlog_opt): define new pseudo log_option named "defaults", which is an alias for "fatal,error,user,warning,info". * scripts/amd.conf.5, doc/am-utils.texi, amd/amd.8: document new log_option "defaults". * amq/amq.8: typo. Arg name for -D is "debug_options" not "log_options". --- diff --git a/ChangeLog b/ChangeLog index a9dbd39..4065f1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2005-08-14 Erez Zadok + * libamu/xutil.c (xlog_opt): define new pseudo log_option named + "defaults", which is an alias for "fatal,error,user,warning,info". + + * scripts/amd.conf.5, doc/am-utils.texi, amd/amd.8: document new + log_option "defaults". + + * amq/amq.8: typo. Arg name for -D is "debug_options" not + "log_options". + * libamu/xutil.c: make xlog_level static, and initialize it to XLOG_DEFAULT. (cmdoption): take unsigned int as flags argument, and print any diff --git a/NEWS b/NEWS index 1948511..a02b2d9 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ remain small, but they are important to keep on, so Amd can report serious problems (including errors relating to incorrectly setting other log options). +Amd now understands a new log_option called "defaults" which is synonymous +with "fatal,error,user,warning,info" (and is also what logging happens by +default). + *** Notes specific to am-utils version 6.1.1 New amd.conf global parameter: forced_unmounts (default to "no"). If set to diff --git a/amd/amd.8 b/amd/amd.8 index dd5f6b9..84d70fe 100644 --- a/amd/amd.8 +++ b/amd/amd.8 @@ -236,8 +236,8 @@ The default is 2 minutes. .TP .BI \-x " options" Specify run-time logging options. The options are a comma separated -list chosen from: fatal, error, user, warn, info, map, stats, all. -Note that "fatal" and "error" are mandatory and cannot be turned off. +list chosen from: fatal, error, user, warn, info, map, stats, defaults, and +all. Note that "fatal" and "error" are mandatory and cannot be turned off. .TP .BI \-y " domain" diff --git a/amq/amq.8 b/amq/amq.8 index 84fee9a..494fbcf 100644 --- a/amq/amq.8 +++ b/amq/amq.8 @@ -155,7 +155,7 @@ from now on. Note that the "fatal" and "error" options cannot be turned off. .TP -.BI \-D " log_options" +.BI \-D " debug_options" Ask the automounter to use the debugging options specified in .I debug_options from now on. diff --git a/doc/am-utils.texi b/doc/am-utils.texi index b2428b3..73e7277 100644 --- a/doc/am-utils.texi +++ b/doc/am-utils.texi @@ -2829,10 +2829,15 @@ Mount map usage Additional statistics @item all All of the above +@item defaults +An alias for "fatal,error,user,warning,info". @end table Initially a set of default logging flags is enabled. This is as if -@samp{-x all,nomap,nostats} had been selected. The command line is +@samp{-x defaults} +or +@samp{-x fatal,error,user,warning,info} +had been selected. The command line is parsed and logging is controlled by the @code{-x} option. The very first set of logging flags is saved and can not be subsequently disabled using @i{Amq}. This default set of options is useful for general production @@ -2865,7 +2870,6 @@ of the message types.@refill @samp{LOG_INFO} @end table - The options can be prefixed by the string @samp{no} to indicate that this option should be turned off. For example, to obtain all but @samp{info} messages the option @samp{-x all,noinfo} would be used. @@ -4653,7 +4657,7 @@ is generally a bad idea to use those reserved for other services such as @subsection @t{log_options} Parameter @cindex log_options Parameter -(type=string, default fatal+error+user+warning+info). Same as the @code{-x} +(type=string, default=``defaults''). Same as the @code{-x} option to @i{Amd}. Specify any logging options for @i{Amd}. Options are comma delimited, and can be preceded by the string @samp{no} to negate their meaning. The @samp{debug} logging option is only available @@ -4664,6 +4668,8 @@ values are: @table @samp @item all all messages +@item defaults +an alias for "fatal,error,user,warning,info" @item debug debug messages @item error diff --git a/include/am_utils.h b/include/am_utils.h index a5bab28..6d06244 100644 --- a/include/am_utils.h +++ b/include/am_utils.h @@ -109,6 +109,7 @@ #define XLOG_DEBUG 0x0020 #define XLOG_MAP 0x0040 #define XLOG_STATS 0x0080 +/* log option compositions */ #define XLOG_MASK 0x00ff /* mask for all flags */ #define XLOG_MANDATORY (XLOG_FATAL|XLOG_ERROR) /* cannot turn these off */ #define XLOG_ALL (XLOG_FATAL|XLOG_ERROR|XLOG_USER|XLOG_WARNING|XLOG_INFO|XLOG_MAP|XLOG_STATS) diff --git a/libamu/xutil.c b/libamu/xutil.c index 4cd39dd..f28d09e 100644 --- a/libamu/xutil.c +++ b/libamu/xutil.c @@ -116,6 +116,7 @@ struct opt_tab dbg_opt[] = struct opt_tab xlog_opt[] = { {"all", XLOG_ALL}, /* All messages */ + {"defaults", XLOG_DEFAULT}, /* Default messages */ #ifdef DEBUG {"debug", XLOG_DEBUG}, /* Debug messages */ #endif /* DEBUG */ /* DEBUG */ diff --git a/scripts/amd.conf.5 b/scripts/amd.conf.5 index 8b1bfc6..53568ca 100644 --- a/scripts/amd.conf.5 +++ b/scripts/amd.conf.5 @@ -409,7 +409,7 @@ then Amd will log messages via using the LOG_LOCAL7 facility (if it exists on the system). .TP -.BR log_options " (string, default=fatal+error+user+warning+info)" +.BR log_options " (string, default=defaults)" Same as the .B \-x option to Amd. Specify any logging options for Amd. Options are comma @@ -423,6 +423,7 @@ Possible values are: .nf \fBall\fR all messages +\fBdefaults\fR default messages (fatal,error,user,warning,info) \fBdebug\fR debug messages \fBerror\fR non-fatal system errors (cannot be turned off) \fBfatal\fR fatal errors (cannot be turned off)