Skip to content

Commit

Permalink
create log folder if not existent
Browse files Browse the repository at this point in the history
  • Loading branch information
greaka committed Jul 4, 2019
1 parent a67abeb commit dc4f32a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/worker/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ use std::io::Write;
use std::sync::mpsc::Receiver;

static NAME: &'static str = "log";
static FILE_PATH: &'static str = "addons/bhud";
static FILE_NAME: &'static str = "addons/bhud/errors.log";

pub fn new() {
let action = |rx: Receiver<ChannelType>| {
std::fs::create_dir_all(FILE_PATH);
let mut file_res = OpenOptions::new().append(true).create(true).open(FILE_NAME);
loop {
let content = rx.recv().unwrap();
Expand Down

0 comments on commit dc4f32a

Please sign in to comment.