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

View File

@ -18,7 +18,7 @@ cfg_if! {
let t2 = get_timestamp(); let t2 = get_timestamp();
let tdiff = ((t2 - t1) as f64)/1000000.0f64; let tdiff = ((t2 - t1) as f64)/1000000.0f64;
info!("running network interface test with {} iterations took {} seconds", count, tdiff); 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 crate::*;
use backtrace::Backtrace; use backtrace::Backtrace;
use std::panic; use std::panic;
use tracing_subscriber::{fmt, prelude::*};
#[no_mangle] #[no_mangle]
#[allow(dead_code)] #[allow(dead_code)]
@ -11,14 +13,9 @@ pub extern "C" fn run_veilid_core_tests() {
pub fn veilid_core_setup_ios_tests() { pub fn veilid_core_setup_ios_tests() {
// Set up subscriber and layers // Set up subscriber and layers
use tracing_subscriber::{filter, fmt, prelude::*};
let filter = VeilidLayerFilter::new(VeilidConfigLogLevel::Trace, None); let filter = VeilidLayerFilter::new(VeilidConfigLogLevel::Trace, None);
let fmt_layer = fmt::layer(); let fmt_layer = fmt::layer().with_filter(filter);
let layer = tracing_android::layer("veilid-core").expect("failed to set up android logging"); tracing_subscriber::registry().with(fmt_layer).init();
tracing_subscriber::registry()
.with(filters)
.with(fmt_layer)
.init();
panic::set_hook(Box::new(|panic_info| { panic::set_hook(Box::new(|panic_info| {
let bt = Backtrace::new(); let bt = Backtrace::new();

View File

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