From e93ba8b887c7dc8bd992d841ed615d8b10b424d3 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 28 May 2014 16:37:38 +0200 Subject: [PATCH] Fix handling --client-min-messages and --log-min-messages. Should help with issue #67 by allowing --client-min-messages to effectively control entering the debugger in case of unhandled conditions, etc. Contrary to the discussion, in this patch --log-min-messages has no impact on the behavior of the console and interactive behaviors. --- src/main.lisp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main.lisp b/src/main.lisp index 9556e4a..0f349f7 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -129,6 +129,19 @@ (let ((*self-upgraded-already* t)) (main argv)))) + ;; parse the log thresholds + (setf *log-min-messages* + (log-threshold log-min-messages + :quiet quiet :verbose verbose :debug debug) + + *client-min-messages* + (log-threshold client-min-messages + :quiet quiet :verbose verbose :debug debug) + + verbose (member *client-min-messages* '(:info :debug :data)) + debug (member *client-min-messages* '(:debug :data)) + quiet (and (not verbose) (not debug))) + ;; First care about the root directory where pgloader is supposed to ;; output its data logs and reject files (let ((root-dir-truename (probe-file root-dir))) @@ -177,13 +190,7 @@ ;; Now process the arguments (when arguments ;; Start the logs system - (let ((*log-filename* (log-file-name logfile)) - (*log-min-messages* - (log-threshold log-min-messages - :quiet quiet :verbose verbose :debug debug)) - (*client-min-messages* - (log-threshold client-min-messages - :quiet quiet :verbose verbose :debug debug))) + (let ((*log-filename* (log-file-name logfile))) (with-monitor () ;; tell the user where to look for interesting things