From ce1ee04942db4ee1c3139a3cb0d33cfe591fa959 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 6 Feb 2023 12:20:31 +0100 Subject: Make the log-level a base option --- scripts/nar-herder.in | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 2e2563c..19ed332 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -84,12 +84,26 @@ (lambda (opt name arg result) (alist-cons 'storage arg - (alist-delete 'storage result)))))) + (alist-delete 'storage result)))) + + (option '("log-level") #t #f + (lambda (opt name arg result) + (alist-cons 'log-level + (let ((level (string->symbol (string-upcase arg)))) + (if (member level %valid-log-levels) + level + (error + (simple-format #f "unknown log level ~A\nvalid levels are: ~A\n" + level + %valid-log-levels)))) + (alist-delete 'log-level result)))))) (define %base-option-defaults ;; Alist of default option values `((database . ,(string-append (getcwd) "/nar_herder.db")) - (database-dump . ,(string-append (getcwd) "/nar_herder_dump.db")))) + (database-dump . ,(string-append (getcwd) "/nar_herder_dump.db")) + + (log-level . DEBUG))) (define %import-options (list (option '("tag") #t #f @@ -220,26 +234,12 @@ (lambda (opt name arg result) (alist-cons 'mirror arg - (alist-delete 'mirror result)))) - - (option '("log-level") #t #f - (lambda (opt name arg result) - (alist-cons 'log-level - (let ((level (string->symbol (string-upcase arg)))) - (if (member level %valid-log-levels) - level - (error - (simple-format #f "unknown log level ~A\nvalid levels are: ~A\n" - level - %valid-log-levels)))) - (alist-delete 'log-level result)))))) + (alist-delete 'mirror result)))))) (define %server-option-defaults '((port . 8080) (host . "0.0.0.0") - (log-level . DEBUG) - (storage-limit . "none") (cached-compression-workers . 2) -- cgit v1.2.3