Skip to content

Commit

Permalink
Added lto to release tags, fixed issue with non-existant log files
Browse files Browse the repository at this point in the history
  • Loading branch information
cnsr committed May 31, 2021
1 parent 75412ad commit 6180b2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[profile.release]
lto = true

[dependencies]
tokio = { version = "1", features = ["full"] }
reqwest = { version = "0.11", features = ["json", "cookies"] }
Expand All @@ -19,4 +22,4 @@ linked-hash-map = "0.5.4"
regex = "1.5.4"
rand = "0.8.3"
log = "0.4.14"
chrono = "0.4.19"
chrono = "0.4.19"
4 changes: 2 additions & 2 deletions src/logger/logger.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use log::{Record, Level, Metadata};
use std::{fs::OpenOptions, io::Write, path::Path};
// TODO: look into tokio::time usage
use chrono::prelude::*;

pub struct AnnaLogger;

// TODO: check the size of the logfile, cleanup if needed?
impl log::Log for AnnaLogger {
fn enabled(&self, metadata: &Metadata) -> bool {
metadata.level() <= Level::Info
Expand All @@ -18,7 +18,7 @@ impl log::Log for AnnaLogger {
}
let create = Path::new(logfile).exists();
let mut file = OpenOptions::new()
.create(create)
.create(!create)
.write(true)
.append(true)
.open(logfile)
Expand Down

0 comments on commit 6180b2f

Please sign in to comment.