mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-11 10:22:33 +03:00
Merge pull request #860 from AleoHQ/windows-colors-cli
[CLI] Adds colors to Windows cmd
This commit is contained in:
commit
93493a467b
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1352,6 +1352,7 @@ dependencies = [
|
||||
name = "leo-lang"
|
||||
version = "1.3.0"
|
||||
dependencies = [
|
||||
"ansi_term 0.12.1",
|
||||
"anyhow",
|
||||
"clap",
|
||||
"colored",
|
||||
|
@ -150,6 +150,10 @@ features = [ "fmt" ]
|
||||
[dependencies.zip]
|
||||
version = "0.5"
|
||||
|
||||
# add ansi support for Windows builds
|
||||
[target.'cfg(windows)'.dependencies.ansi_term]
|
||||
version = "0.12.1"
|
||||
|
||||
[dev-dependencies.rusty-hook]
|
||||
version = "0.11.2"
|
||||
|
||||
|
@ -202,6 +202,10 @@ where
|
||||
|
||||
/// Initialize logger with custom format and verbosity.
|
||||
pub fn init_logger(_app_name: &'static str, verbosity: usize) {
|
||||
// This line enables Windows 10 ANSI coloring API.
|
||||
#[cfg(target_family = "windows")]
|
||||
ansi_term::enable_ansi_support();
|
||||
|
||||
let subscriber = FmtSubscriber::builder()
|
||||
// all spans/events with a level higher than TRACE (e.g, debug, info, warn, etc.)
|
||||
// will be written to stdout.
|
||||
|
Loading…
Reference in New Issue
Block a user