support log path none
This commit is contained in:
parent
115b74c7cc
commit
74f968e284
@ -22,10 +22,10 @@ use log::{Level, LevelFilter, Log, Metadata, Record};
|
|||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use simplelog::*;
|
use simplelog::*;
|
||||||
|
|
||||||
use crate::utils::{GlobalConfig, ProcessControl};
|
use crate::utils::{PlayoutConfig, ProcessControl};
|
||||||
|
|
||||||
/// send log messages to mail recipient
|
/// send log messages to mail recipient
|
||||||
pub fn send_mail(cfg: &GlobalConfig, msg: String) {
|
pub fn send_mail(cfg: &PlayoutConfig, msg: String) {
|
||||||
let recip = cfg
|
let recip = cfg
|
||||||
.mail
|
.mail
|
||||||
.recipient
|
.recipient
|
||||||
@ -68,7 +68,7 @@ pub fn send_mail(cfg: &GlobalConfig, msg: String) {
|
|||||||
///
|
///
|
||||||
/// Check every give seconds for messages and send them.
|
/// Check every give seconds for messages and send them.
|
||||||
fn mail_queue(
|
fn mail_queue(
|
||||||
cfg: GlobalConfig,
|
cfg: PlayoutConfig,
|
||||||
proc_ctl: ProcessControl,
|
proc_ctl: ProcessControl,
|
||||||
messages: Arc<Mutex<Vec<String>>>,
|
messages: Arc<Mutex<Vec<String>>>,
|
||||||
interval: u64,
|
interval: u64,
|
||||||
@ -166,7 +166,7 @@ fn clean_string(text: &str) -> String {
|
|||||||
/// - file logger
|
/// - file logger
|
||||||
/// - mail logger
|
/// - mail logger
|
||||||
pub fn init_logging(
|
pub fn init_logging(
|
||||||
config: &GlobalConfig,
|
config: &PlayoutConfig,
|
||||||
proc_ctl: Option<ProcessControl>,
|
proc_ctl: Option<ProcessControl>,
|
||||||
messages: Option<Arc<Mutex<Vec<String>>>>,
|
messages: Option<Arc<Mutex<Vec<String>>>>,
|
||||||
) -> Vec<Box<dyn SharedLogger>> {
|
) -> Vec<Box<dyn SharedLogger>> {
|
||||||
@ -195,7 +195,7 @@ pub fn init_logging(
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if app_config.log_to_file {
|
if app_config.log_to_file && &app_config.log_path != "none" {
|
||||||
let file_config = log_config
|
let file_config = log_config
|
||||||
.clone()
|
.clone()
|
||||||
.set_time_format_custom(format_description!(
|
.set_time_format_custom(format_description!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user