Skip to content

Commit ac5dcfc

Browse files
committed
fix: use debug level tracing for ast related tracing
1 parent b703f21 commit ac5dcfc

File tree

20 files changed

+154
-154
lines changed

20 files changed

+154
-154
lines changed

crates/swc_ecma_codegen/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ impl MacroNode for Program {
14151415

14161416
#[node_impl]
14171417
impl MacroNode for Module {
1418-
#[tracing::instrument(skip_all)]
1418+
#[tracing::instrument(level="debug",skip_all)]
14191419
fn emit(&mut self, emitter: &mut Macro) -> Result {
14201420
emitter.emit_leading_comments_of_span(self.span(), false)?;
14211421

@@ -1443,7 +1443,7 @@ impl MacroNode for Module {
14431443

14441444
#[node_impl]
14451445
impl MacroNode for Script {
1446-
#[tracing::instrument(skip_all)]
1446+
#[tracing::instrument(level="debug",skip_all)]
14471447
fn emit(&mut self, emitter: &mut Macro) -> Result {
14481448
emitter.emit_leading_comments_of_span(self.span(), false)?;
14491449

crates/swc_ecma_compat_es2015/src/classes/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ impl Classes {
935935
}
936936
}
937937

938-
#[tracing::instrument(level = "info", skip_all)]
938+
#[tracing::instrument(level = "debug", skip_all)]
939939
fn inject_class_call_check(c: &mut Vec<Stmt>, name: Ident) {
940940
let mut class_name_sym = name.clone();
941941
class_name_sym.span = DUMMY_SP;
@@ -956,7 +956,7 @@ fn inject_class_call_check(c: &mut Vec<Stmt>, name: Ident) {
956956
}
957957

958958
/// Returns true if no `super` is used before `super()` call.
959-
#[tracing::instrument(level = "info", skip_all)]
959+
#[tracing::instrument(level = "debug", skip_all)]
960960
fn is_always_initialized(body: &[Stmt]) -> bool {
961961
struct SuperFinder {
962962
found: bool,

crates/swc_ecma_compat_es2015/src/destructuring.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ fn make_ref_ident(c: Config, decls: &mut Vec<VarDeclarator>, init: Option<Box<Ex
11371137
make_ref_ident_for_array(c, decls, init, None)
11381138
}
11391139

1140-
#[tracing::instrument(level = "info", skip_all)]
1140+
#[tracing::instrument(level = "debug", skip_all)]
11411141
fn make_ref_ident_for_array(
11421142
c: Config,
11431143
decls: &mut Vec<VarDeclarator>,

crates/swc_ecma_compat_es2015/src/for_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ impl ForOf {
560560
/// }
561561
/// }
562562
/// ```
563-
#[tracing::instrument(level = "info", skip_all)]
563+
#[tracing::instrument(level = "debug", skip_all)]
564564
fn make_finally_block(
565565
iterator_return: Box<Expr>,
566566
normal_completion_ident: &Ident,

crates/swc_ecma_compat_es2015/src/generator.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ impl VisitMut for Generator {
974974
}
975975
}
976976

977-
#[tracing::instrument(skip_all)]
977+
#[tracing::instrument(level="debug",skip_all)]
978978
fn visit_mut_stmt(&mut self, node: &mut Stmt) {
979979
match node {
980980
Stmt::Break(b) => {
@@ -3089,7 +3089,7 @@ impl Generator {
30893089
});
30903090
}
30913091

3092-
#[tracing::instrument(skip(self))]
3092+
#[tracing::instrument(level="debug",skip(self))]
30933093
fn try_enter_label(&mut self, op_index: usize) {
30943094
if self.label_offsets.is_none() {
30953095
return;
@@ -3143,7 +3143,7 @@ impl Generator {
31433143
}
31443144

31453145
/// Tries to enter or leave a code block.
3146-
#[tracing::instrument(skip(self))]
3146+
#[tracing::instrument(level="debug",skip(self))]
31473147
fn try_enter_or_leave_block(&mut self, op_index: usize) {
31483148
if let Some(blocks) = &self.blocks {
31493149
while self.block_index < self.block_actions.as_ref().unwrap().len()
@@ -3210,7 +3210,7 @@ impl Generator {
32103210

32113211
/// Writes an operation as a statement to the current label's statement
32123212
/// list.
3213-
#[tracing::instrument(skip(self))]
3213+
#[tracing::instrument(level="debug",skip(self))]
32143214
fn write_operation(&mut self, op_index: usize) {
32153215
if cfg!(debug_assertions) {
32163216
debug!("Writing operation {}", op_index);

crates/swc_ecma_compat_es2015/src/spread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ impl Spread {
462462
}
463463
}
464464

465-
#[tracing::instrument(level = "info", skip_all)]
465+
#[tracing::instrument(level = "debug", skip_all)]
466466
fn expand_literal_args(
467467
args: impl ExactSizeIterator<Item = Option<ExprOrSpread>>,
468468
) -> Vec<Option<ExprOrSpread>> {

crates/swc_ecma_compat_es2015/src/typeof_symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl VisitMut for TypeOfSymbol {
138138
}
139139
}
140140

141-
#[tracing::instrument(level = "info", skip_all)]
141+
#[tracing::instrument(level = "debug", skip_all)]
142142
fn is_non_symbol_literal(e: &Expr) -> bool {
143143
match e {
144144
Expr::Lit(Lit::Str(Str { value, .. })) => matches!(

crates/swc_ecma_compat_es2016/src/exponentiation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl VisitMut for Exponentiation {
136136
}
137137
}
138138

139-
#[tracing::instrument(level = "info", skip_all)]
139+
#[tracing::instrument(level = "debug", skip_all)]
140140
fn mk_call(span: Span, left: Box<Expr>, right: Box<Expr>) -> Expr {
141141
// Math.pow()
142142
CallExpr {

crates/swc_ecma_compat_es2017/src/async_to_generator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl VisitMut for AsyncToGenerator {
399399
/// Creates
400400
///
401401
/// `_async_to_generator(function*() {})()` from `async function() {}`;
402-
#[tracing::instrument(level = "info", skip_all)]
402+
#[tracing::instrument(level = "debug", skip_all)]
403403
fn make_fn_ref(fn_state: &FnState, params: Vec<Param>, body: BlockStmt) -> Expr {
404404
let helper = if fn_state.is_generator {
405405
helper_expr!(PURE_SP, wrap_async_generator)
@@ -439,7 +439,7 @@ fn make_fn_ref(fn_state: &FnState, params: Vec<Param>, body: BlockStmt) -> Expr
439439
}
440440
}
441441

442-
#[tracing::instrument(level = "info", skip_all)]
442+
#[tracing::instrument(level = "debug", skip_all)]
443443
fn could_potentially_throw(param: &[Param], unresolved_ctxt: SyntaxContext) -> bool {
444444
for param in param {
445445
debug_assert!(param.decorators.is_empty());
@@ -500,7 +500,7 @@ impl Check for ShouldWork {
500500
}
501501
}
502502

503-
#[tracing::instrument(level = "info", skip_all)]
503+
#[tracing::instrument(level = "debug", skip_all)]
504504
fn handle_await_for(stmt: &mut Stmt, is_async_generator: bool) {
505505
let s = match stmt {
506506
Stmt::ForOf(s @ ForOfStmt { is_await: true, .. }) => s.take(),

crates/swc_ecma_compat_es2018/src/object_rest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ impl ObjectRest {
889889
}
890890
}
891891

892-
#[tracing::instrument(level = "info", skip_all)]
892+
#[tracing::instrument(level = "debug", skip_all)]
893893
fn object_without_properties(
894894
obj: Box<Expr>,
895895
excluded_props: Vec<Option<ExprOrSpread>>,
@@ -967,7 +967,7 @@ fn object_without_properties(
967967
.into()
968968
}
969969

970-
#[tracing::instrument(level = "info", skip_all)]
970+
#[tracing::instrument(level = "debug", skip_all)]
971971
fn excluded_props(props: &[ObjectPatProp]) -> Vec<Option<ExprOrSpread>> {
972972
props
973973
.iter()

crates/swc_ecma_compat_es2020/src/nullish_coalescing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl VisitMut for NullishCoalescing {
224224
}
225225
}
226226

227-
#[tracing::instrument(level = "info", skip_all)]
227+
#[tracing::instrument(level = "debug", skip_all)]
228228
fn make_cond(c: Config, span: Span, alias: &Ident, var_expr: Expr, init: Box<Expr>) -> Expr {
229229
if c.no_document_all {
230230
CondExpr {

crates/swc_ecma_minifier/src/compress/optimize/iife.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl Optimizer<'_> {
139139
/// })(x);
140140
/// })(7);
141141
/// ```
142-
#[cfg_attr(feature = "debug", tracing::instrument(skip(self, e)))]
142+
#[cfg_attr(feature = "debug", tracing::instrument(level="debug",skip(self, e)))]
143143
pub(super) fn inline_args_of_iife(&mut self, e: &mut CallExpr) {
144144
if self.options.inline == 0 && !self.options.reduce_vars && !self.options.reduce_fns {
145145
return;
@@ -409,7 +409,7 @@ impl Optimizer<'_> {
409409
}
410410
}
411411

412-
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
412+
#[cfg_attr(feature = "debug", tracing::instrument(level="debug",skip_all))]
413413
pub(super) fn inline_vars_in_node<N>(&mut self, n: &mut N, mut vars: FxHashMap<Id, Box<Expr>>)
414414
where
415415
N: for<'aa> VisitMutWith<NormalMultiReplacer<'aa>>,

0 commit comments

Comments
 (0)