Add basic plist file

This commit is contained in:
Federico Terzi 2019-09-13 16:17:47 +02:00
parent ee793dc700
commit 3e976784b8
2 changed files with 26 additions and 6 deletions

View File

@ -11,7 +11,7 @@ use clap::{App, Arg};
use std::path::Path;
use std::sync::mpsc::Receiver;
use log::{info, error, LevelFilter};
use simplelog::{CombinedLogger, TermLogger, TerminalMode};
use simplelog::{CombinedLogger, TermLogger, TerminalMode, SharedLogger};
use std::process::exit;
mod ui;
@ -54,12 +54,18 @@ fn main() {
1 => LevelFilter::Info,
2 | _ => LevelFilter::Debug,
};
let mut log_outputs: Vec<Box<dyn SharedLogger>> = Vec::new();
// Initialize terminal output
let terminal_out = TermLogger::new(log_level, simplelog::Config::default(), TerminalMode::Mixed);
if let Some(terminal_out) = terminal_out {
log_outputs.push(terminal_out);
}
//TODO: WriteLogger::new(LevelFilter::Info, Config::default(), File::create("my_rust_binary.log").unwrap()),
CombinedLogger::init(
vec![
TermLogger::new(log_level, simplelog::Config::default(), TerminalMode::Mixed).unwrap(),
//WriteLogger::new(LevelFilter::Info, Config::default(), File::create("my_rust_binary.log").unwrap()),
]
).unwrap();
log_outputs
).expect("Error opening log destination");
info!("espanso is starting...");

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.federicoterzi.espanso</string>
<key>ProgramArguments</key>
<array>
<string>/Users/freddy/Documents/espanso</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>