diff options
author | Dale Mellor <mcron-lsfnyl@rdmp.org> | 2022-07-07 16:51:31 +0100 |
---|---|---|
committer | Dale Mellor <mcron-lsfnyl@rdmp.org> | 2022-07-07 16:51:31 +0100 |
commit | e2ecb8045bc9789b109b1e7e0b282269a33ca9fb (patch) | |
tree | 1cc499e54f84052838260537cc94ecd46ccd0db6 /src/mcron/scripts | |
parent | a7a456cd6fab22eab69303a4430edf5501187299 (diff) | |
download | mcron-e2ecb8045bc9789b109b1e7e0b282269a33ca9fb.tar.gz mcron-e2ecb8045bc9789b109b1e7e0b282269a33ca9fb.tar.bz2 mcron-e2ecb8045bc9789b109b1e7e0b282269a33ca9fb.zip |
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
Diffstat (limited to 'src/mcron/scripts')
-rw-r--r-- | src/mcron/scripts/mcron.scm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mcron/scripts/mcron.scm b/src/mcron/scripts/mcron.scm index 300aad0..11c0e34 100644 --- a/src/mcron/scripts/mcron.scm +++ b/src/mcron/scripts/mcron.scm @@ -42,6 +42,7 @@ standard input), or use all the files in ~/.config/cron (or the deprecated -i, --stdin=(guile|vixie) Format of data passed as standard input (default guile) -s, --schedule[=N] Display the next N (or 8) jobs that will be run + -l, --log Write log messages to standard output --log-format=FMT (ice-9 format) format string for log messages --date-format=FMT (srfi srfi-19) date format string for log messages -?, --help Give this help list @@ -122,6 +123,7 @@ directory. Double-check the folder and file permissions and syntax.")))) (string=? in "vixie"))))) (schedule (single-char #\s) (value optional) (predicate ,string->number)) + (log (single-char #\l) (value #f)) (log-format (value #t) (predicate ,validate-log-format)) (date-format (value #t) (predicate ,validate-date-format)) (help (single-char #\?)) @@ -147,6 +149,7 @@ directory. Double-check the folder and file permissions and syntax.")))) (else (exit 0))))) (parameterize - ((%log-format (option-ref options 'log-format (%log-format))) + ((%do-logging (option-ref options 'log (%do-logging))) + (%log-format (option-ref options 'log-format (%log-format))) (%date-format (option-ref options 'date-format (%date-format)))) (run-job-loop)))) |