mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-10-01 01:26:08 -04:00
xfer
This commit is contained in:
parent
ff56634667
commit
86dee2b6ed
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -5380,6 +5380,7 @@ dependencies = [
|
||||
"opentelemetry",
|
||||
"opentelemetry-otlp",
|
||||
"opentelemetry-semantic-conventions",
|
||||
"paranoid-android",
|
||||
"parking_lot 0.12.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
@ -41,6 +41,8 @@ impl ProtectedStore {
|
||||
|
||||
#[instrument(level = "debug", skip(self), err)]
|
||||
pub async fn init(&self) -> EyreResult<()> {
|
||||
log_pstore!(error "ASDFASDFASDF");
|
||||
|
||||
let delete = {
|
||||
let c = self.config.get();
|
||||
let mut inner = self.inner.lock();
|
||||
@ -48,11 +50,19 @@ impl ProtectedStore {
|
||||
// Attempt to open the secure keyring
|
||||
cfg_if! {
|
||||
if #[cfg(target_os = "android")] {
|
||||
inner.keyring_manager = KeyringManager::new_secure(&c.program_name, crate::intf::android::get_android_globals()).ok();
|
||||
let maybe_km = KeyringManager::new_secure(&c.program_name, crate::intf::android::get_android_globals());
|
||||
} else {
|
||||
inner.keyring_manager = KeyringManager::new_secure(&c.program_name).ok();
|
||||
let maybe_km = KeyringManager::new_secure(&c.program_name);
|
||||
}
|
||||
}
|
||||
|
||||
inner.keyring_manager = match maybe_km {
|
||||
Ok(v) => Some(v),
|
||||
Err(e) => {
|
||||
log_pstore!(error "Failed to create secure keyring manager: {}", e);
|
||||
None
|
||||
}
|
||||
};
|
||||
}
|
||||
if (c.protected_store.always_use_insecure_storage
|
||||
|| c.protected_store.allow_insecure_fallback)
|
||||
@ -78,6 +88,7 @@ impl ProtectedStore {
|
||||
);
|
||||
}
|
||||
if inner.keyring_manager.is_none() {
|
||||
log_pstore!(error "QWERQWER");
|
||||
bail!("Could not initialize the protected store.");
|
||||
}
|
||||
c.protected_store.delete
|
||||
|
@ -2,8 +2,8 @@ import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -63,3 +63,4 @@ hostname = "^0"
|
||||
# Dependencies for Android builds only
|
||||
[target.'cfg(target_os = "android")'.dependencies]
|
||||
jni = "^0"
|
||||
paranoid-android = "0.2.1"
|
||||
|
@ -166,14 +166,26 @@ pub extern "C" fn initialize_veilid_core(platform_config: FfiStr) {
|
||||
|
||||
// Terminal logger
|
||||
if platform_config.logging.terminal.enabled {
|
||||
let filter =
|
||||
veilid_core::VeilidLayerFilter::new(platform_config.logging.terminal.level, None);
|
||||
let layer = tracing_subscriber::fmt::Layer::new()
|
||||
.compact()
|
||||
.with_writer(std::io::stdout)
|
||||
.with_filter(filter.clone());
|
||||
filters.insert("terminal", filter);
|
||||
layers.push(layer.boxed());
|
||||
cfg_if! {
|
||||
if #[cfg(target_os = "android")] {
|
||||
let filter =
|
||||
veilid_core::VeilidLayerFilter::new(platform_config.logging.terminal.level, None);
|
||||
let layer = paranoid_android::layer("veilid-flutter")
|
||||
.with_ansi(false)
|
||||
.with_filter(filter.clone());
|
||||
filters.insert("terminal", filter);
|
||||
layers.push(layer.boxed());
|
||||
} else {
|
||||
let filter =
|
||||
veilid_core::VeilidLayerFilter::new(platform_config.logging.terminal.level, None);
|
||||
let layer = tracing_subscriber::fmt::Layer::new()
|
||||
.compact()
|
||||
.with_writer(std::io::stdout)
|
||||
.with_filter(filter.clone());
|
||||
filters.insert("terminal", filter);
|
||||
layers.push(layer.boxed());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// OpenTelemetry logger
|
||||
@ -237,6 +249,7 @@ pub extern "C" fn initialize_veilid_core(platform_config: FfiStr) {
|
||||
.try_init()
|
||||
.map_err(|e| format!("failed to initialize logging: {}", e))
|
||||
.expect("failed to initalize ffi platform");
|
||||
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -177,6 +177,14 @@ macro_rules! log_pstore {
|
||||
(warn $fmt:literal, $($arg:expr),+) => {
|
||||
warn!(target:"pstore", $fmt, $($arg),+);
|
||||
};
|
||||
(debug $text:expr) => { debug!(
|
||||
target: "pstore",
|
||||
"{}",
|
||||
$text,
|
||||
)};
|
||||
(debug $fmt:literal, $($arg:expr),+) => {
|
||||
debug!(target:"pstore", $fmt, $($arg),+);
|
||||
};
|
||||
($text:expr) => {trace!(
|
||||
target: "pstore",
|
||||
"{}",
|
||||
|
Loading…
Reference in New Issue
Block a user