Skip to content

Commit

Permalink
chore(rust): logs adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbenavides committed Dec 18, 2024
1 parent 720aed1 commit 1222158
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl OckamLogFormat {
}

fn format_timestamp(&self, writer: &mut Writer<'_>) -> std::fmt::Result {
let now = chrono::Utc::now().format("%Y-%m-%d %H:%M:%S%.3f");
let now = chrono::Utc::now().format("%Y-%m-%dT%H:%M:%S%.6f");
if writer.has_ansi_escapes() {
let style = Style::new().dimmed();
write!(writer, "{}", style.prefix())?;
Expand Down
1 change: 0 additions & 1 deletion implementations/rust/ockam/ockam_api/src/logs/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use opentelemetry::trace::TracerProvider;
use opentelemetry::{global, KeyValue};
use opentelemetry_appender_tracing::layer::OpenTelemetryTracingBridge;
use opentelemetry_otlp::WithExportConfig;
use opentelemetry_sdk as sdk;
use opentelemetry_sdk::export::logs::LogExporter;
use opentelemetry_sdk::export::trace::SpanExporter;
use opentelemetry_sdk::logs::{BatchLogProcessor, LoggerProvider};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ impl NodeManager {

info!(
%alias, %address, ?authorized, ?relay_address,
forwarding_route = ?relay_info.forwarding_route(),
remote_address = ?relay_info.remote_address(),
"relay created"
);
Expand Down
5 changes: 0 additions & 5 deletions implementations/rust/ockam/ockam_api/tests/logging_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ use ockam_api::logs::{

use opentelemetry::global;
use opentelemetry::trace::Tracer;

use opentelemetry_sdk as sdk;
use sdk::testing::logs::*;
use sdk::testing::trace::*;

use opentelemetry_sdk::testing::logs::InMemoryLogsExporter;
use opentelemetry_sdk::testing::trace::InMemorySpanExporter;
use std::fs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl CreateCommand {
// Set node_name so that node can isolate its data in the storage from other nodes
self.get_or_create_identity(&opts, &self.identity).await?;
let _notification_handler = if self.foreground_args.child_process {
// If enabled, the user's terminal will receive notifications
// If enabled, the user's terminal would receive notifications
// from the node after the command exited.
None
} else {
Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_command/src/node/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub async fn is_node_up(
.ask_with_timeout::<(), NodeStatus>(ctx, api::query_status(), Duration::from_secs(1))
.await
{
if status.status.is_running() {
if status.process_status.is_running() {
return Ok(true);
}
}
Expand Down
2 changes: 0 additions & 2 deletions implementations/rust/ockam/ockam_command/src/relay/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ impl Command for CreateCommand {
let alias = cmd.relay_name();
let return_timing = cmd.return_timing();

// let _notification_handler = NotificationHandler::start(&opts.state, opts.terminal.clone());

let node = BackgroundNodeClient::create(ctx, &opts.state, &cmd.to).await?;
let relay_info = {
if at.starts_with(Project::CODE) && cmd.authorized.is_some() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Context {
pub(crate) async fn receiver_next(&mut self) -> Result<Option<RelayMessage>> {
loop {
let relay_msg = if let Some(msg) = self.receiver.recv().await.map(|msg| {
trace!("{}: received new message!", self.address());
trace!(address=%self.address(), "received new message!");

// First we update the mailbox fill metrics
self.mailbox_count.fetch_sub(1, Ordering::Acquire);
Expand Down

0 comments on commit 1222158

Please sign in to comment.