Switch from simplelog to env_logger

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
pull/56/head
Michal Rostecki 2 years ago
parent 8c6016040e
commit 3b831ffda3

@ -10,11 +10,11 @@ aya-log = "0.1"
{{project-name}}-common = { path = "../{{project-name}}-common", features=["user"] } {{project-name}}-common = { path = "../{{project-name}}-common", features=["user"] }
anyhow = "1.0.42" anyhow = "1.0.42"
clap = { version = "3.1", features = ["derive"] } clap = { version = "3.1", features = ["derive"] }
env_logger = "0.9"
{%- if program_type == "uprobe" %} {%- if program_type == "uprobe" %}
libc = "0.2.102" libc = "0.2.102"
{%- endif %} {%- endif %}
log = "0.4" log = "0.4"
simplelog = "0.12"
tokio = { version = "1.18", features = ["macros", "rt", "rt-multi-thread", "net", "signal"] } tokio = { version = "1.18", features = ["macros", "rt", "rt-multi-thread", "net", "signal"] }
[[bin]] [[bin]]

@ -39,7 +39,6 @@ use aya::programs::SocketFilter;
use aya_log::BpfLogger; use aya_log::BpfLogger;
use clap::Parser; use clap::Parser;
use log::info; use log::info;
use simplelog::{ColorChoice, ConfigBuilder, LevelFilter, TermLogger, TerminalMode};
use tokio::signal; use tokio::signal;
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
@ -60,15 +59,7 @@ struct Opt {
async fn main() -> Result<(), anyhow::Error> { async fn main() -> Result<(), anyhow::Error> {
let opt = Opt::parse(); let opt = Opt::parse();
TermLogger::init( env_logger::init();
LevelFilter::Debug,
ConfigBuilder::new()
.set_target_level(LevelFilter::Error)
.set_location_level(LevelFilter::Error)
.build(),
TerminalMode::Mixed,
ColorChoice::Auto,
)?;
// This will include your eBPF object file as raw bytes at compile-time and load it at // This will include your eBPF object file as raw bytes at compile-time and load it at
// runtime. This approach is recommended for most real-world use cases. If you would // runtime. This approach is recommended for most real-world use cases. If you would

Loading…
Cancel
Save