From e2ecb8045bc9789b109b1e7e0b282269a33ca9fb Mon Sep 17 00:00:00 2001 From: Dale Mellor Date: Thu, 7 Jul 2022 16:51:31 +0100 Subject: Give mcron --log option to turn logging on. This makes the behaviour backwards compatible with all previous uses of mcron. * src/mcron/base.scm: establish %do-logging parameter and act on it * src/mcron/scripts/mcron.scm: set %do-logging according to command line * tests/base.scm: some tests require %do-logging to be set --- tests/base.scm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'tests/base.scm') diff --git a/tests/base.scm b/tests/base.scm index 914b4c6..7d7b6d7 100644 --- a/tests/base.scm +++ b/tests/base.scm @@ -234,13 +234,14 @@ (sigaction SIGCHLD SIG_DFL)))))) (test-assert "run-job, output" - (let ((output (dummy-job/capture-output - (lambda () - (format #t "output line 1~%") - (format #t "output line 2\nand 3~%") - (system "echo poutine") - (format (current-error-port) - "some error~%"))))) + (let ((output (parameterize ((%do-logging #t)) + (dummy-job/capture-output + (lambda () + (format #t "output line 1~%") + (format #t "output line 2\nand 3~%") + (system "echo poutine") + (format (current-error-port) + "some error~%")))))) (assert (string-contains output "dummy: running")) (assert (string-contains output "dummy: output line 1")) (assert (string-contains output "dummy: and 3")) @@ -270,7 +271,8 @@ (const #t))) (test-assert "run-job, output with custom format" - (let ((output (parameterize ((%log-format "the message only: ~3@*~a~%")) + (let ((output (parameterize ((%do-logging #t) + (%log-format "the message only: ~3@*~a~%")) (dummy-job/capture-output (lambda () (format #t "output line 1~%")))))) -- cgit v1.2.3