dev: disable all runtime check to log::debug! (#912)

This commit is contained in:
Myriad-Dreamin 2024-11-29 19:52:42 +08:00 committed by GitHub
parent 8b495fe2ab
commit ed79045588
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 158 additions and 159 deletions

View file

@ -754,12 +754,12 @@ impl SharedContext {
}
pub(crate) fn type_of_func(self: &Arc<Self>, func: Func) -> Signature {
log::debug!("convert runtime func {func:?}");
crate::log_debug_ct!("convert runtime func {func:?}");
analyze_signature(self, SignatureTarget::Convert(func)).unwrap()
}
pub(crate) fn type_of_value(self: &Arc<Self>, val: &Value) -> Ty {
log::debug!("convert runtime value {val:?}");
crate::log_debug_ct!("convert runtime value {val:?}");
// todo: check performance on peeking signature source frequently
let cache_key = val;
@ -832,7 +832,7 @@ impl SharedContext {
}
pub(crate) fn sig_of_def(self: &Arc<Self>, def: Definition) -> Option<Signature> {
log::debug!("check definition func {def:?}");
crate::log_debug_ct!("check definition func {def:?}");
let source = def.decl.file_id().and_then(|f| self.source_by_id(f).ok());
analyze_signature(self, SignatureTarget::Def(source, def))
}
@ -961,19 +961,19 @@ impl SharedContext {
/// Check on a module before really needing them. But we likely use them
/// after a while.
pub(crate) fn prefetch_type_check(self: &Arc<Self>, _fid: TypstFileId) {
// log::debug!("prefetch type check {fid:?}");
// crate::log_debug_ct!("prefetch type check {fid:?}");
// let this = self.clone();
// rayon::spawn(move || {
// let Some(source) = this.world.source(fid).ok() else {
// return;
// };
// this.type_check(&source);
// // log::debug!("prefetch type check end {fid:?}");
// // crate::log_debug_ct!("prefetch type check end {fid:?}");
// });
}
pub(crate) fn preload_package(self: Arc<Self>, entry_point: TypstFileId) {
log::debug!("preload package start {entry_point:?}");
crate::log_debug_ct!("preload package start {entry_point:?}");
#[derive(Clone)]
struct Preloader {
@ -983,7 +983,7 @@ impl SharedContext {
impl Preloader {
fn work(&self, fid: TypstFileId) {
log::debug!("preload package {fid:?}");
crate::log_debug_ct!("preload package {fid:?}");
let source = self.shared.source_by_id(fid).ok().unwrap();
let expr = self.shared.expr_stage(&source);
self.shared.type_check(&source);