Skip to content

Commit

Permalink
refactor(runtime,codegen): avoid double timestamps problem (#1210)
Browse files Browse the repository at this point in the history
* refactor(codegen): create a fmt subscriber without time

* refactor(runtime): emit resource tracker logs without timestmap
  • Loading branch information
iulianbarbu committed Sep 8, 2023
1 parent 9f391ee commit a7d0ee0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion codegen/src/shuttle_main/mod.rs
Expand Up @@ -16,8 +16,10 @@ pub(crate) fn r#impl(_attr: TokenStream, item: TokenStream) -> TokenStream {
let tracing_setup = if cfg!(feature = "setup-tracing") {
Some(quote! {
use shuttle_runtime::colored::*;
use shuttle_runtime::tracing_subscriber::{registry, fmt, prelude::*};
shuttle_runtime::colored::control::set_override(true);
shuttle_runtime::tracing_subscriber::fmt::init();
registry().with(fmt::layer().without_time()).init();

println!(
"{}\n{}\nTo disable tracing, remove the default features from {}:\n{}\n{}",
"Shuttle's default tracing subscriber is initialized!".yellow().bold(),
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/resource_tracker.rs
Expand Up @@ -56,7 +56,7 @@ impl ResourceTracker {

macro_rules! log {
($msg:expr) => {
println!("{} [Resource][{}] {}", chrono::Utc::now(), B::TYPE, $msg);
println!("[Resource][{}] {}", B::TYPE, $msg);
};
}

Expand Down

0 comments on commit a7d0ee0

Please sign in to comment.