Skip to content

Commit 5f0f400

Browse files
committed
Merge branch 'release/v0.1.1'
2 parents 39eb895 + 4d80776 commit 5f0f400

File tree

3 files changed

+18
-54
lines changed

3 files changed

+18
-54
lines changed

Cargo.lock

Lines changed: 3 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "blocking-io-client"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2018"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -20,5 +20,5 @@ tokio = { version = "1.13.0", features = ["rt"] }
2020
uuid = { version = "0.8", features = ["serde", "v4"] }
2121
toml = "0.5"
2222
tracing = "0.1"
23-
tracing-subscriber = "0.2"
23+
tracing-subscriber = "0.3"
2424
tracing-unwrap = "0.9"

src/main.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
2+
13
use std::collections::VecDeque;
24
use std::ffi::CString;
5+
use std::fs::File;
36
use std::sync::Arc;
47
use std::sync::Mutex;
58

@@ -57,7 +60,16 @@ fn main() {
5760
} else {
5861
tracing::Level::INFO
5962
};
60-
tracing_subscriber::fmt().with_max_level(level).init();
63+
if cfg!(debug_assertions) {
64+
tracing_subscriber::fmt().pretty().with_max_level(level).init();
65+
} else {
66+
let log_file = File::create("blocking-io-log.txt").unwrap_or_log();
67+
tracing_subscriber::fmt()
68+
.with_writer(Mutex::new(log_file))
69+
.with_ansi(false)
70+
.with_max_level(level)
71+
.init();
72+
};
6173
}
6274

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

0 commit comments

Comments
 (0)