mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-12-25 15:29:32 -05:00
fix tests
This commit is contained in:
parent
ef6ecdab79
commit
ad45660db9
@ -710,7 +710,7 @@ impl Network {
|
|||||||
self.unlocked_inner
|
self.unlocked_inner
|
||||||
.interfaces
|
.interfaces
|
||||||
.with_interfaces(|interfaces| {
|
.with_interfaces(|interfaces| {
|
||||||
debug!("interfaces: {:#?}", interfaces);
|
log_net!(debug "interfaces: {:#?}", interfaces);
|
||||||
|
|
||||||
for intf in interfaces.values() {
|
for intf in interfaces.values() {
|
||||||
// Skip networks that we should never encounter
|
// Skip networks that we should never encounter
|
||||||
|
@ -268,7 +268,7 @@ impl Network {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("spawn_socket_listener: binding successful to {}", addr);
|
log_net!(debug "spawn_socket_listener: binding successful to {}", addr);
|
||||||
|
|
||||||
// Create protocol handler records
|
// Create protocol handler records
|
||||||
let listener_state = Arc::new(RwLock::new(ListenerState::new()));
|
let listener_state = Arc::new(RwLock::new(ListenerState::new()));
|
||||||
|
@ -17,14 +17,14 @@ impl Network {
|
|||||||
}
|
}
|
||||||
trace!("task_count: {}", task_count);
|
trace!("task_count: {}", task_count);
|
||||||
for _ in 0..task_count {
|
for _ in 0..task_count {
|
||||||
trace!("Spawning UDP listener task");
|
log_net!("Spawning UDP listener task");
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Run thread task to process stream of messages
|
// Run thread task to process stream of messages
|
||||||
let this = self.clone();
|
let this = self.clone();
|
||||||
|
|
||||||
let jh = spawn(async move {
|
let jh = spawn(async move {
|
||||||
trace!("UDP listener task spawned");
|
log_net!("UDP listener task spawned");
|
||||||
|
|
||||||
// Collect all our protocol handlers into a vector
|
// Collect all our protocol handlers into a vector
|
||||||
let mut protocol_handlers: Vec<RawUdpProtocolHandler> = this
|
let mut protocol_handlers: Vec<RawUdpProtocolHandler> = this
|
||||||
|
@ -8,7 +8,7 @@ use super::*;
|
|||||||
impl StorageManager {
|
impl StorageManager {
|
||||||
pub(crate) fn setup_tasks(&self) {
|
pub(crate) fn setup_tasks(&self) {
|
||||||
// Set flush records tick task
|
// Set flush records tick task
|
||||||
debug!("starting flush record stores task");
|
log_stor!(debug "starting flush record stores task");
|
||||||
{
|
{
|
||||||
let this = self.clone();
|
let this = self.clone();
|
||||||
self.unlocked_inner
|
self.unlocked_inner
|
||||||
@ -29,7 +29,7 @@ impl StorageManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Set offline subkey writes tick task
|
// Set offline subkey writes tick task
|
||||||
debug!("starting offline subkey writes task");
|
log_stor!(debug "starting offline subkey writes task");
|
||||||
{
|
{
|
||||||
let this = self.clone();
|
let this = self.clone();
|
||||||
self.unlocked_inner
|
self.unlocked_inner
|
||||||
@ -50,7 +50,7 @@ impl StorageManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Set send value changes tick task
|
// Set send value changes tick task
|
||||||
debug!("starting send value changes task");
|
log_stor!(debug "starting send value changes task");
|
||||||
{
|
{
|
||||||
let this = self.clone();
|
let this = self.clone();
|
||||||
self.unlocked_inner
|
self.unlocked_inner
|
||||||
@ -71,7 +71,7 @@ impl StorageManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Set check active watches tick task
|
// Set check active watches tick task
|
||||||
debug!("starting check active watches task");
|
log_stor!(debug "starting check active watches task");
|
||||||
{
|
{
|
||||||
let this = self.clone();
|
let this = self.clone();
|
||||||
self.unlocked_inner
|
self.unlocked_inner
|
||||||
@ -117,19 +117,19 @@ impl StorageManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn cancel_tasks(&self) {
|
pub(crate) async fn cancel_tasks(&self) {
|
||||||
debug!("stopping check active watches task");
|
log_stor!(debug "stopping check active watches task");
|
||||||
if let Err(e) = self.unlocked_inner.check_active_watches_task.stop().await {
|
if let Err(e) = self.unlocked_inner.check_active_watches_task.stop().await {
|
||||||
warn!("check_active_watches_task not stopped: {}", e);
|
warn!("check_active_watches_task not stopped: {}", e);
|
||||||
}
|
}
|
||||||
debug!("stopping send value changes task");
|
log_stor!(debug "stopping send value changes task");
|
||||||
if let Err(e) = self.unlocked_inner.send_value_changes_task.stop().await {
|
if let Err(e) = self.unlocked_inner.send_value_changes_task.stop().await {
|
||||||
warn!("send_value_changes_task not stopped: {}", e);
|
warn!("send_value_changes_task not stopped: {}", e);
|
||||||
}
|
}
|
||||||
debug!("stopping flush record stores task");
|
log_stor!(debug "stopping flush record stores task");
|
||||||
if let Err(e) = self.unlocked_inner.flush_record_stores_task.stop().await {
|
if let Err(e) = self.unlocked_inner.flush_record_stores_task.stop().await {
|
||||||
warn!("flush_record_stores_task not stopped: {}", e);
|
warn!("flush_record_stores_task not stopped: {}", e);
|
||||||
}
|
}
|
||||||
debug!("stopping offline subkey writes task");
|
log_stor!(debug "stopping offline subkey writes task");
|
||||||
if let Err(e) = self.unlocked_inner.offline_subkey_writes_task.stop().await {
|
if let Err(e) = self.unlocked_inner.offline_subkey_writes_task.stop().await {
|
||||||
warn!("offline_subkey_writes_task not stopped: {}", e);
|
warn!("offline_subkey_writes_task not stopped: {}", e);
|
||||||
}
|
}
|
||||||
|
@ -27,21 +27,26 @@ logging:
|
|||||||
system:
|
system:
|
||||||
enabled: false
|
enabled: false
|
||||||
level: 'info'
|
level: 'info'
|
||||||
|
ignore_log_targets: []
|
||||||
terminal:
|
terminal:
|
||||||
enabled: true
|
enabled: true
|
||||||
level: 'info'
|
level: 'info'
|
||||||
|
ignore_log_targets: []
|
||||||
file:
|
file:
|
||||||
enabled: false
|
enabled: false
|
||||||
path: ''
|
path: ''
|
||||||
append: true
|
append: true
|
||||||
level: 'info'
|
level: 'info'
|
||||||
|
ignore_log_targets: []
|
||||||
api:
|
api:
|
||||||
enabled: true
|
enabled: true
|
||||||
level: 'info'
|
level: 'info'
|
||||||
|
ignore_log_targets: []
|
||||||
otlp:
|
otlp:
|
||||||
enabled: false
|
enabled: false
|
||||||
level: 'trace'
|
level: 'trace'
|
||||||
grpc_endpoint: 'localhost:4317'
|
grpc_endpoint: 'localhost:4317'
|
||||||
|
ignore_log_targets: []
|
||||||
console:
|
console:
|
||||||
enabled: false
|
enabled: false
|
||||||
testing:
|
testing:
|
||||||
@ -922,17 +927,22 @@ impl Settings {
|
|||||||
set_config_value!(inner.auto_attach, value);
|
set_config_value!(inner.auto_attach, value);
|
||||||
set_config_value!(inner.logging.system.enabled, value);
|
set_config_value!(inner.logging.system.enabled, value);
|
||||||
set_config_value!(inner.logging.system.level, value);
|
set_config_value!(inner.logging.system.level, value);
|
||||||
|
set_config_value!(inner.logging.system.ignore_log_targets, value);
|
||||||
set_config_value!(inner.logging.terminal.enabled, value);
|
set_config_value!(inner.logging.terminal.enabled, value);
|
||||||
set_config_value!(inner.logging.terminal.level, value);
|
set_config_value!(inner.logging.terminal.level, value);
|
||||||
|
set_config_value!(inner.logging.terminal.ignore_log_targets, value);
|
||||||
set_config_value!(inner.logging.file.enabled, value);
|
set_config_value!(inner.logging.file.enabled, value);
|
||||||
set_config_value!(inner.logging.file.path, value);
|
set_config_value!(inner.logging.file.path, value);
|
||||||
set_config_value!(inner.logging.file.append, value);
|
set_config_value!(inner.logging.file.append, value);
|
||||||
set_config_value!(inner.logging.file.level, value);
|
set_config_value!(inner.logging.file.level, value);
|
||||||
|
set_config_value!(inner.logging.file.ignore_log_targets, value);
|
||||||
set_config_value!(inner.logging.api.enabled, value);
|
set_config_value!(inner.logging.api.enabled, value);
|
||||||
set_config_value!(inner.logging.api.level, value);
|
set_config_value!(inner.logging.api.level, value);
|
||||||
|
set_config_value!(inner.logging.api.ignore_log_targets, value);
|
||||||
set_config_value!(inner.logging.otlp.enabled, value);
|
set_config_value!(inner.logging.otlp.enabled, value);
|
||||||
set_config_value!(inner.logging.otlp.level, value);
|
set_config_value!(inner.logging.otlp.level, value);
|
||||||
set_config_value!(inner.logging.otlp.grpc_endpoint, value);
|
set_config_value!(inner.logging.otlp.grpc_endpoint, value);
|
||||||
|
set_config_value!(inner.logging.otlp.ignore_log_targets, value);
|
||||||
set_config_value!(inner.logging.console.enabled, value);
|
set_config_value!(inner.logging.console.enabled, value);
|
||||||
set_config_value!(inner.testing.subnode_index, value);
|
set_config_value!(inner.testing.subnode_index, value);
|
||||||
set_config_value!(inner.core.capabilities.disable, value);
|
set_config_value!(inner.core.capabilities.disable, value);
|
||||||
|
@ -42,8 +42,10 @@ impl VeilidClient {
|
|||||||
|
|
||||||
// Performance logger
|
// Performance logger
|
||||||
if platformConfig.logging.performance.enabled {
|
if platformConfig.logging.performance.enabled {
|
||||||
let filter =
|
let filter = veilid_core::VeilidLayerFilter::new(
|
||||||
veilid_core::VeilidLayerFilter::new(platformConfig.logging.performance.level, None);
|
platformConfig.logging.performance.level,
|
||||||
|
&platformConfig.logging.performance.ignore_log_targets,
|
||||||
|
);
|
||||||
let layer = WASMLayer::new(
|
let layer = WASMLayer::new(
|
||||||
WASMLayerConfigBuilder::new()
|
WASMLayerConfigBuilder::new()
|
||||||
.set_report_logs_in_timings(platformConfig.logging.performance.logs_in_timings)
|
.set_report_logs_in_timings(platformConfig.logging.performance.logs_in_timings)
|
||||||
@ -61,8 +63,10 @@ impl VeilidClient {
|
|||||||
|
|
||||||
// API logger
|
// API logger
|
||||||
if platformConfig.logging.api.enabled {
|
if platformConfig.logging.api.enabled {
|
||||||
let filter =
|
let filter = veilid_core::VeilidLayerFilter::new(
|
||||||
veilid_core::VeilidLayerFilter::new(platformConfig.logging.api.level, None);
|
platformConfig.logging.api.level,
|
||||||
|
&platformConfig.logging.api.ignore_log_targets,
|
||||||
|
);
|
||||||
let layer = veilid_core::ApiTracingLayer::get().with_filter(filter.clone());
|
let layer = veilid_core::ApiTracingLayer::get().with_filter(filter.clone());
|
||||||
filters.insert("api", filter);
|
filters.insert("api", filter);
|
||||||
layers.push(layer.boxed());
|
layers.push(layer.boxed());
|
||||||
|
@ -5,12 +5,14 @@ export const veilidCoreInitConfig: VeilidWASMConfig = {
|
|||||||
api: {
|
api: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
level: 'Debug',
|
level: 'Debug',
|
||||||
|
ignore_log_targets: [],
|
||||||
},
|
},
|
||||||
performance: {
|
performance: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
level: 'Info',
|
level: 'Info',
|
||||||
logs_in_timings: false,
|
logs_in_timings: false,
|
||||||
logs_in_console: false,
|
logs_in_console: false,
|
||||||
|
ignore_log_targets: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user