aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 56aa2af2..d389ec46 100644
--- a/src/main.c
+++ b/src/main.c
@@ -805,7 +805,7 @@ enum mailfromd_option {
OPTION_DUMP_XREF,
OPTION_EXPIRE,
OPTION_FOREGROUND,
- OPTION_DEBUG_GACOPYZ,
+ OPTION_GACOPYZ_LOG,
OPTION_IGNORE_FAILED_READS,
OPTION_LINT,
OPTION_LOG_TAG,
@@ -958,8 +958,8 @@ static struct argp_option options[] = {
{ "xref", OPTION_DUMP_XREF, NULL, 0,
N_("Produce a cross-reference listing"), GRP+1 },
{ "dump-xref", 0, NULL, OPTION_ALIAS, NULL, GRP+1 },
- { "gacopyz-debug", OPTION_DEBUG_GACOPYZ, NULL, 0,
- N_("Milter protocol trace"), GRP+1 },
+ { "gacopyz-log", OPTION_GACOPYZ_LOG, N_("LEVEL"), 0,
+ N_("Set Gacopyz log level"), GRP+1 },
{ "stderr", 's', NULL, 0,
N_("Log to stderr"), GRP+1 },
{ "syslog", OPTION_SYSLOG, NULL, 0,
@@ -1201,9 +1201,15 @@ parse_opt (int key, char *arg, struct argp_state *state)
foreground = 1;
break;
- case OPTION_DEBUG_GACOPYZ:
- smfi_setdbg(1);
+ case OPTION_GACOPYZ_LOG:
+ {
+ int lev = gacopyz_string_to_log_level(arg);
+ if (lev == -1)
+ argp_error(state, "%s: invalid Gacopyz log level",
+ arg);
+ smfi_setlogmask(SMI_LOG_FROM(lev));
break;
+ }
case OPTION_LIST:
need_config = 0;
@@ -1259,7 +1265,11 @@ parse_opt (int key, char *arg, struct argp_state *state)
case OPTION_TRACE_PROGRAM:
enable_prog_trace(arg ? arg: "all");
break;
-
+
+ case ARGP_KEY_INIT:
+ smfi_setlogmask(SMI_LOG_FROM(SMI_LOG_WARN));
+ break;
+
case ARGP_KEY_FINI:
if (validate_options())
exit(EX_USAGE);

Return to:

Send suggestions and report system problems to the System administrator.