Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
build(deps): Use env_logger instead of simplelog
Browse files Browse the repository at this point in the history
Closes #28, #30.

Signed-off-by: Sanchith Hegde <sanchith.hegde01@gmail.com>
  • Loading branch information
SanchithHegde committed Oct 19, 2021
1 parent 6e726d4 commit c223da2
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 58 deletions.
98 changes: 57 additions & 41 deletions Cargo.lock

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

14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
[package]
authors = ["Sanchith Hegde <sanchith.hegde01@gmail.com>"]
authors = [ "Sanchith Hegde <sanchith.hegde01@gmail.com>" ]
edition = "2018"
name = "boyer_moore"
version = "0.1.0"

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

[dependencies]
anyhow = "1.0.44"
log = "0.4.14"
simplelog = "0.10.2"
termcolor = "1.1.2"
anyhow = "1.0.44"
env_logger = "0.9.0"
log = "0.4.14"
termcolor = "1.1.2"

[profile.release]
codegen-units = 1
lto = "fat"
lto = "fat"

[features]
12 changes: 1 addition & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::{Context, Result};
use boyer_moore::BoyerMoore;
use log::error;
use simplelog::{ConfigBuilder, LevelFilter, TermLogger, TerminalMode};
use std::{
io::{self, Write},
iter::repeat,
Expand Down Expand Up @@ -176,16 +175,7 @@ fn boyer_moore_search(

fn main() {
let mut stdout = StandardStream::stdout(ColorChoice::Auto);
TermLogger::init(
LevelFilter::Info,
ConfigBuilder::new().set_time_to_local(true).build(),
TerminalMode::Mixed,
ColorChoice::Auto,
)
.map_err(|err| {
println!("Failed to initialize logger: {}", err);
})
.unwrap();
env_logger::init();

const ALPHABET: &str = "abcdefghijklmnoprstuvwxyz ";

Expand Down

0 comments on commit c223da2

Please sign in to comment.