Skip to content

Commit

Permalink
Changed log info to debug, added time reporting for parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-mcdaniel committed Sep 7, 2024
1 parent 37bb819 commit c088667
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ rayon = "1.10"
## ERROR REPORTING
#######################################
codespan-reporting = "0.11"
log = {version = "0.4", features = ["release_max_level_error"] }
log = {version = "0.4", features = ["release_max_level_info"] }
env_logger = "0.11"

#######################################
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ pub fn parse(
include_builtins: bool,
include_std: bool,
) -> Result<Expr, String> {
let start_time = std::time::Instant::now();
let mut expr = parse_source(&without_comments(input), filename.map(|x| x.to_owned()))?;
use log::info;
info!("Parsed {} in {}ms", filename.unwrap_or("input"), start_time.elapsed().as_millis());
use crate::side_effects::Output;
if include_std {
let std_lib = parse_module("std", &without_comments(include_str!("std_lib.sg")))?;
Expand Down
2 changes: 1 addition & 1 deletion src/lir/types/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ impl TypeCheck for Expr {
expr: self.clone(),
});
} else {
info!("Found {found} can decay to {expected} in {self}")
debug!("Found {found} can decay to {expected} in {self}")
}
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/lir/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@ impl Type {
expr: &Expr,
env: &Env,
) -> Result<(Type, usize), Error> {
info!("Getting offset of member {member} in expression {self} in the environment {env}");
debug!("Getting offset of member {member} in expression {self} in the environment {env}");
match self {
Type::Pointer(_, t) => t.get_member_offset(member, expr, env),
Type::Struct(members) => {
Expand Down

0 comments on commit c088667

Please sign in to comment.