From 4ea9eea237f017b9b6a08fa1f94aab0e83fade1f Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Fri, 29 Sep 2023 08:43:53 +0200 Subject: [PATCH] fix log none argument --- ffplayout-engine/src/utils/mod.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ffplayout-engine/src/utils/mod.rs b/ffplayout-engine/src/utils/mod.rs index 97a2ceda..1e6d37e0 100644 --- a/ffplayout-engine/src/utils/mod.rs +++ b/ffplayout-engine/src/utils/mod.rs @@ -1,4 +1,8 @@ -use std::{fs::File, path::PathBuf, process::exit}; +use std::{ + fs::File, + path::{Path, PathBuf}, + process::exit, +}; use regex::Regex; use serde_json::{json, Map, Value}; @@ -71,10 +75,12 @@ pub fn get_config(args: Args) -> PlayoutConfig { } if let Some(log_path) = args.log { - if log_path.is_dir() { + if &log_path != Path::new("none") && log_path.is_dir() { config.logging.log_to_file = true; + config.logging.path = log_path; + } else { + config.logging.log_to_file = false; } - config.logging.path = log_path; } if let Some(playlist) = args.playlist {