Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shuttle-next): enable tracing by default #1219

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cargo-shuttle/src/args.rs
Expand Up @@ -350,7 +350,7 @@ pub(crate) fn parse_init_path(path: OsString) -> Result<PathBuf, io::Error> {
)
})?;

parse_path(path.clone()).map_err(|e| io::Error::new(ErrorKind::InvalidInput, e))
parse_path(path).map_err(|e| io::Error::new(ErrorKind::InvalidInput, e))
}

#[cfg(test)]
Expand Down
3 changes: 1 addition & 2 deletions cargo-shuttle/src/lib.rs
Expand Up @@ -700,7 +700,6 @@ impl Shuttle {

// Clones to send to spawn
let service_name_clone = service_name.clone().to_string();
let deployment_id_clone = deployment_id.clone();

let child_stdout = runtime
.stdout
Expand All @@ -710,7 +709,7 @@ impl Shuttle {
tokio::spawn(async move {
while let Some(line) = reader.next_line().await.unwrap() {
let log_item = LogItem::new(
deployment_id_clone,
deployment_id,
shuttle_common::log::Backend::Runtime(service_name_clone.clone()),
line,
);
Expand Down
6 changes: 6 additions & 0 deletions codegen/src/next/mod.rs
Expand Up @@ -347,6 +347,12 @@ pub(crate) fn wasi_bindings(app: App) -> proc_macro2::TokenStream {
use std::io::{Read, Write};
use std::os::wasi::io::FromRawFd;

use shuttle_next::tracing_prelude::*;

shuttle_next::tracing_registry()
.with(shuttle_next::tracing_fmt::layer().without_time())
.init();

// file descriptor 3 for reading and writing http parts
let mut parts_fd = unsafe { std::fs::File::from_raw_fd(parts_fd) };

Expand Down
2 changes: 1 addition & 1 deletion services/shuttle-next/Cargo.toml
Expand Up @@ -20,4 +20,4 @@ rmp-serde = "1.1.1"
tower-service = "0.3.1"
shuttle-common = { path = "../../common", version = "0.25.0", features = ["wasm"] }
shuttle-codegen = { path = "../../codegen", version = "0.25.0", features = ["next"] }
tracing-subscriber = { version = "0.3.16", default-features = false, features = ["registry", "std"] }
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "registry"] }
4 changes: 3 additions & 1 deletion services/shuttle-next/src/lib.rs
Expand Up @@ -5,4 +5,6 @@ pub use rmp_serde::from_read;
pub use shuttle_codegen::app;
pub use shuttle_common::wasm::{RequestWrapper, ResponseWrapper};
pub use tower_service::Service;
pub use tracing_subscriber::{prelude as tracing_prelude, registry as tracing_registry};
pub use tracing_subscriber::{
fmt as tracing_fmt, prelude as tracing_prelude, registry as tracing_registry,
};