Skip to content

Commit

Permalink
sprofiler-test: add command line option --log-level
Browse files Browse the repository at this point in the history
Signed-off-by: Takashi IIGUNI <[email protected]>
  • Loading branch information
guni1192 committed Feb 22, 2022
1 parent 722cdaf commit dae6973
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 29 deletions.
1 change: 0 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Vagrant.configure("2") do |config|
config.vm.define :sprofiler_dev do |node|

node.vm.synced_folder ".", "/vagrant", type: "rsync"
node.vm.synced_folder "./integration_test/sprofiler-bpf/hooks", "/usr/share/containers/oci/hooks.d", type: "rsync"

node.vm.provider :libvirt do |domain|
domain.memory = 8192
Expand Down
2 changes: 2 additions & 0 deletions sprofiler-test/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.x86_64-unknown-linux-gnu]
runner = 'sudo -E'
26 changes: 0 additions & 26 deletions sprofiler-test/sprofiler-test.yaml

This file was deleted.

11 changes: 9 additions & 2 deletions sprofiler-test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;

use anyhow::Result;
use clap::Parser;
use tracing::trace;
use tracing::{trace, Level};

mod testing;
use testing::run_tests;
Expand All @@ -14,16 +14,23 @@ mod seccomp;
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
struct Args {
/// Test case files
tests_file: PathBuf,

/// Log Level (TRACE, INFO, )
#[clap(short, long, default_value_t = Level::INFO)]
log_level: Level,
}

fn main() -> Result<()> {
let args = Args::parse();

tracing_subscriber::fmt()
.with_target(false)
.with_max_level(args.log_level)
.without_time()
.init();

let args = Args::parse();
let reader = File::open(args.tests_file)?;
let testing = serde_yaml::from_reader(&reader)?;

Expand Down

0 comments on commit dae6973

Please sign in to comment.