Introduce the stderr logger to the project

This commit is contained in:
Kerollmops 2020-07-12 11:04:35 +02:00
parent 12358476da
commit f757df5dfd
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
3 changed files with 30 additions and 1 deletions

View file

@ -20,6 +20,10 @@ struct Opt {
#[structopt(long = "db", parse(from_os_str))]
database: PathBuf,
/// Verbose mode (-v, -vv, -vvv, etc.)
#[structopt(short, long, parse(from_occurrences))]
verbose: usize,
/// The query string to search for (doesn't support prefix search yet).
query: Option<String>,
}
@ -27,6 +31,12 @@ struct Opt {
fn main() -> anyhow::Result<()> {
let opt = Opt::from_args();
stderrlog::new()
.verbosity(opt.verbose)
.show_level(false)
.timestamp(stderrlog::Timestamp::Off)
.init()?;
std::fs::create_dir_all(&opt.database)?;
let env = EnvOpenOptions::new()
.map_size(100 * 1024 * 1024 * 1024) // 100 GB