aboutsummaryrefslogtreecommitdiff
path: root/genenetwork
diff options
context:
space:
mode:
Diffstat (limited to 'genenetwork')
-rw-r--r--genenetwork/services/genenetwork.scm15
1 files changed, 13 insertions, 2 deletions
diff --git a/genenetwork/services/genenetwork.scm b/genenetwork/services/genenetwork.scm
index ef59701..022eeda 100644
--- a/genenetwork/services/genenetwork.scm
+++ b/genenetwork/services/genenetwork.scm
@@ -30,7 +30,9 @@
#:use-module (gnu system file-systems)
#:use-module (gnu system shadow)
#:use-module (guix build python-build-system)
+ #:use-module (guix diagnostics)
#:use-module (guix gexp)
+ #:use-module (guix i18n)
#:use-module (guix packages)
#:use-module (guix profiles)
#:use-module (guix records)
@@ -104,7 +106,8 @@
(gn-auth-secrets genenetwork-configuration-gn-auth-secrets
(default "/etc/genenetwork"))
(log-level genenetwork-configuration-log-level
- (default 'warning)))
+ (default 'warning)
+ (sanitize sanitize-log-level)))
(define-record-type* <gn-uploader-configuration>
gn-uploader-configuration make-gn-uploader-configuration
@@ -126,7 +129,15 @@
(gn2-server-url gn-uploader-configuration-gn2-server-url
(default "https://genenetwork.org"))
(log-level gn-uploader-configuration-log-level
- (default 'warning)))
+ (default 'warning)
+ (sanitize sanitize-log-level)))
+
+(define (sanitize-log-level log-level)
+ (case log-level
+ ((fatal error warning info debug trace) log-level)
+ (else
+ (leave (G_ "Log level ~a is invalid. It must be one of the following symbols---fatal, error, warn, info, debug or trace.~%")
+ log-level))))
(define %genenetwork-accounts
(list (user-group