commit fd5f65733422b00fe95866c25786915d7b08fb40 parent da9605f2d2ec127c1a800d49b435df82f7e7af7a 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!(