diff options
author | Christopher Baines <mail@cbaines.net> | 2023-02-06 12:20:31 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-02-06 12:20:31 +0100 |
commit | ce1ee04942db4ee1c3139a3cb0d33cfe591fa959 (patch) | |
tree | 8322dc2a536f71af12dc976784204e1e9528f5b2 /scripts | |
parent | 3cd133bc03996bfb0498e05f41c89e86aff34fb6 (diff) | |
download | nar-herder-ce1ee04942db4ee1c3139a3cb0d33cfe591fa959.tar nar-herder-ce1ee04942db4ee1c3139a3cb0d33cfe591fa959.tar.gz |
Make the log-level a base option
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/nar-herder.in | 34 |
1 files changed, 17 insertions, 17 deletions
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) |