commit c18a273b4ad49cfba0bf932e6748c0e16a2ad06f parent ca24a4adf1ac94f671267b4f9e517572c1014df8 Author: pjsier <pjsier@gmail.com> Date: Wed, 28 Dec 2022 18:30:25 -0600 Log message to stderr if LOG_FILE is not writable Co-authored-by: Helmut K. C. Tessarek <tessarek@evermeet.cx> Diffstat:
M | src/config.rs | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/config.rs b/src/config.rs @@ -690,6 +690,12 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> { } } + if let Some(log_file) = &cfg.log_file { + if std::fs::OpenOptions::new().append(true).create(true).open(log_file).is_err() { + err!("Unable to write to log file", log_file); + } + } + let dom = cfg.domain.to_lowercase(); if !dom.starts_with("http://") && !dom.starts_with("https://") { err!(