Skip to content

Commit

Permalink
Merge branch 'release/v0.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
yuma140902 committed Nov 12, 2021
2 parents 39eb895 + 4d80776 commit 5f0f400
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 54 deletions.
54 changes: 3 additions & 51 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blocking-io-client"
version = "0.1.0"
version = "0.1.1"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -20,5 +20,5 @@ tokio = { version = "1.13.0", features = ["rt"] }
uuid = { version = "0.8", features = ["serde", "v4"] }
toml = "0.5"
tracing = "0.1"
tracing-subscriber = "0.2"
tracing-subscriber = "0.3"
tracing-unwrap = "0.9"
14 changes: 13 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use std::collections::VecDeque;
use std::ffi::CString;
use std::fs::File;
use std::sync::Arc;
use std::sync::Mutex;

Expand Down Expand Up @@ -57,7 +60,16 @@ fn main() {
} else {
tracing::Level::INFO
};
tracing_subscriber::fmt().with_max_level(level).init();
if cfg!(debug_assertions) {
tracing_subscriber::fmt().pretty().with_max_level(level).init();
} else {
let log_file = File::create("blocking-io-log.txt").unwrap_or_log();
tracing_subscriber::fmt()
.with_writer(Mutex::new(log_file))
.with_ansi(false)
.with_max_level(level)
.init();
};
}

let setting = Setting::load().expect_or_log("設定ファイルの読み込みに失敗");
Expand Down

0 comments on commit 5f0f400

Please sign in to comment.