summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-20 05:15:22 +0200
committertv <tv@krebsco.de>2026-10-20 06:12:35 +0200
commitb3d86d1d487ec6c77c84e0721442e8089075f95f (patch)
treecd92e52e90537a2f2877a47d9cf4fecfd11b76fa /src/main.rs
parentc17ad44ab8cb97433e68b5593f67d8672da0db4d (diff)
cleanup logging
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs
index f5cec55..44f9dd4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,7 +15,7 @@ use anyhow::{Context, Result};
use automerge::AutoCommit;
use clap::Parser;
use tokio::sync::{broadcast, mpsc, watch, RwLock};
-use tracing::{error, info};
+use tracing::{debug, error, info, trace};
use url::Url;
mod api;
@@ -114,12 +114,15 @@ async fn main() -> Result<()> {
info!(
bind_addr = args.bind_addr.to_string(),
- mycelium_rest_url = mycelium_rest_url.to_string(),
- "Starting Automerge replication service"
+ "Starting replication service"
+ );
+ debug!(
+ url = mycelium_rest_url.to_string(),
+ "Using Mycelium REST API"
);
let seeds: Vec<String> = args.seeds.unwrap_or_default();
- info!(seed_count = seeds.len(), "Loaded bootstrap configuration");
+ debug!(seed_count = seeds.len(), "Loaded bootstrap configuration");
let (sync_tx, sync_rx) = mpsc::unbounded_channel();
let (change_tx, _) = watch::channel(0_u64);
@@ -133,12 +136,12 @@ async fn main() -> Result<()> {
None => Epoch::GENESIS,
};
let (epoch_tx, _) = watch::channel(initial_epoch);
- info!(epoch = %initial_epoch, "Local epoch");
+ debug!(epoch = %initial_epoch, "Local epoch");
let firewall = Arc::new(Firewall::default());
let mycelium_transport = Arc::new(mycelium::MyceliumTransport::connect(mycelium_setup).await?);
- info!(local_id = mycelium_transport.local_id(), "Transport ready");
+ debug!(local_id = mycelium_transport.local_id(), "Transport ready");
let state = AppState {
doc: Arc::new(RwLock::new(Replica::new(initial_epoch, AutoCommit::new()))),
@@ -160,7 +163,7 @@ async fn main() -> Result<()> {
compaction: Arc::new(compaction::Compaction::default()),
};
- info!("Application state initialized");
+ trace!("Application state initialized");
let consumer_state = state.clone();
tokio::spawn(async move {
@@ -173,25 +176,25 @@ async fn main() -> Result<()> {
}))
.await;
});
- info!("Mycelium consumer task spawned");
+ trace!("Mycelium consumer task spawned");
let sync_state = state.clone();
tokio::spawn(async move {
sync::run_sync_worker(sync_state, sync_rx).await;
});
- info!("Sync worker task spawned");
+ trace!("Sync worker task spawned");
let peer_worker_state = state.clone();
tokio::spawn(async move {
peer::run_peer_worker(peer_worker_state).await;
});
- info!("Peer worker task spawned");
+ trace!("Peer worker task spawned");
// Switches to committed epochs and catches up with newer ones. Starts before
// bootstrapping: a node joining a compacted cluster can only finish its initial sync
// after fetching the current epoch from a peer.
tokio::spawn(compaction::run_worker(state.clone()));
- info!("Compaction worker task spawned");
+ trace!("Compaction worker task spawned");
bootstrap::bootstrap(&state, &seeds)
.await