Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ glob = "0.3.1"
httparse = "1.8"
http = "0.2"
faster-hex = "0.9.0"
tracing = "0.1"

# DEBUG
# [patch.crates-io]
Expand Down
8 changes: 7 additions & 1 deletion crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,27 @@ fn main() -> Result<(), anyhow::Error> {
let local = tokio::task::LocalSet::new();
let res: Result<(), Error> = local.block_on(&runtime, async {
let matches = get_cli().get_matches();
let verbose = matches.get_flag("verbose");

if !matches.get_flag("quiet") {
#[cfg(feature = "tracing")]
{
use tracing_subscriber::fmt::format::FmtSpan;
use tracing_subscriber::EnvFilter;

tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.with_thread_names(true)
.with_span_events(if verbose {
FmtSpan::FULL
} else {
FmtSpan::NONE
})
.init()
}

#[cfg(not(feature = "tracing"))]
{
let verbose = matches.get_flag("verbose");
let include_source = matches.get_flag("log-source");
logger::init(verbose, include_source);
}
Expand Down
1 change: 1 addition & 0 deletions crates/sb_module_loader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ once_cell.workspace = true
deno_tls.workspace = true
monch.workspace = true
base64.workspace = true
tracing.workspace = true
sb_core = { version = "0.1.0", path = "../sb_core" }
sb_node = { version = "0.1.0", path = "../node" }
sb_npm = { version = "0.1.0", path = "../npm" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use deno_core::{ModuleSpecifier, RequestedModuleType};
use deno_semver::npm::NpmPackageReqReference;
use eszip::deno_graph;
use std::sync::Arc;
use tracing::instrument;

use crate::node::cli_node_resolver::CliNodeResolver;
use crate::util::arc_u8_to_arc_str;
Expand All @@ -33,6 +34,7 @@ pub struct EmbeddedModuleLoader {
}

impl ModuleLoader for EmbeddedModuleLoader {
#[instrument(level = "debug", skip(self))]
fn resolve(
&self,
specifier: &str,
Expand Down Expand Up @@ -96,6 +98,7 @@ impl ModuleLoader for EmbeddedModuleLoader {
Ok(specifier)
}

#[instrument(level = "debug", skip_all, fields(specifier = original_specifier.as_str()))]
fn load(
&self,
original_specifier: &ModuleSpecifier,
Expand Down