test debugging

This commit is contained in:
John Smith 2022-11-30 22:48:50 -05:00
parent 89dd5da522
commit b6c446cd39
4 changed files with 11 additions and 14 deletions

View File

@ -1,3 +1,4 @@
use super::native::*;
use crate::*;
use backtrace::Backtrace;
use jni::{
@ -5,9 +6,7 @@ use jni::{
};
use lazy_static::*;
use std::panic;
use tracing::*;
use tracing_subscriber::prelude::*;
use tracing_subscriber::*;
use tracing_subscriber::{filter, fmt, prelude::*};
#[no_mangle]
#[allow(non_snake_case)]
@ -22,12 +21,11 @@ pub extern "system" fn Java_com_veilid_veilid_1core_1android_1tests_MainActivity
pub fn veilid_core_setup_android_tests(env: JNIEnv, ctx: JObject) {
// Set up subscriber and layers
use tracing_subscriber::{filter, fmt, prelude::*};
let filter = VeilidLayerFilter::new(VeilidConfigLogLevel::Trace, None);
let layer = tracing_android::layer("veilid-core").expect("failed to set up android logging");
tracing_subscriber::registry()
.with(filters)
.with(fmt_layer)
.with(filter)
.with(layer)
.init();
// Set up panic hook for backtraces

View File

@ -18,7 +18,7 @@ cfg_if! {
let t2 = get_timestamp();
let tdiff = ((t2 - t1) as f64)/1000000.0f64;
info!("running network interface test with {} iterations took {} seconds", count, tdiff);
info!("interfaces: {:#?}", interfaces)
//info!("interfaces: {:#?}", interfaces)
}
}
}

View File

@ -1,6 +1,8 @@
use super::native::*;
use crate::*;
use backtrace::Backtrace;
use std::panic;
use tracing_subscriber::{fmt, prelude::*};
#[no_mangle]
#[allow(dead_code)]
@ -11,14 +13,9 @@ pub extern "C" fn run_veilid_core_tests() {
pub fn veilid_core_setup_ios_tests() {
// Set up subscriber and layers
use tracing_subscriber::{filter, fmt, prelude::*};
let filter = VeilidLayerFilter::new(VeilidConfigLogLevel::Trace, None);
let fmt_layer = fmt::layer();
let layer = tracing_android::layer("veilid-core").expect("failed to set up android logging");
tracing_subscriber::registry()
.with(filters)
.with(fmt_layer)
.init();
let fmt_layer = fmt::layer().with_filter(filter);
tracing_subscriber::registry().with(fmt_layer).init();
panic::set_hook(Box::new(|panic_info| {
let bt = Backtrace::new();

View File

@ -6,12 +6,14 @@
//
import UIKit
import Darwin
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
run_veilid_core_tests()
exit(0)
}