Skip to content

Commit

Permalink
add color
Browse files Browse the repository at this point in the history
  • Loading branch information
ryqdev committed May 21, 2024
1 parent 09c5ce6 commit acc2ec1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ egui = "0.27.2"
egui_plot = "0.27.2"
eframe = "0.27.2"
ibapi = "0.4.3"
colored = "2.1.0"
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mod cmds;
mod green;
mod err;
mod strategy;
use colored::Colorize;

use crate::{cmds::{Command,
backtest::BackTestCommand,
Expand All @@ -17,9 +18,9 @@ fn init_log() {
writeln!(
buf,
"{}:{} {} [{}] - {}",
record.file().unwrap_or("unknown"),
record.file().unwrap_or("unknown_file"),
record.line().unwrap_or(0),
chrono::Local::now().format("%Y-%m-%dT%H:%M:%S"),
chrono::Local::now().format("%Y-%m-%dT%H:%M:%S").to_string().blue(),
record.level(),
record.args()
)
Expand Down

0 comments on commit acc2ec1

Please sign in to comment.