Skip to content

Commit

Permalink
Reduce log level on indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
suzizecat committed Jan 12, 2025
1 parent 9ee26d4 commit 1a9c61f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Full rework of the indexer.
- Updated CMakeLists.txt to generate proper semver version strings
- Show versions upon start of LSP and indexer (standalone)
- Reduced log level in the indexer (use of trace)

## Fixed

Expand Down
6 changes: 3 additions & 3 deletions indexer/index_reference_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ namespace diplomat::index
bool ReferenceVisitor::_add_reference_from_stx(const slang::SourceRange & loc,
const std::string_view& name)
{
spdlog::debug(" Found reference for name {}", name);
spdlog::trace(" Found reference for name {}", name);
IndexRange node_loc(loc,*_sm);
IndexFile* parent_file = _index->add_file(node_loc.start.file);

IndexScope* ref_scope = parent_file->lookup_scope_by_range(node_loc);
if(! ref_scope)
{
spdlog::debug(" Reference dropped: missing scope");
spdlog::trace(" Reference dropped: missing scope");
return false;
}
IndexSymbol* main_symb = ref_scope->lookup_symbol(std::string(name));
if(! main_symb)
{
spdlog::debug(" Reference dropped: failed to find symbol {} from scope {}",name, ref_scope->get_full_path());
spdlog::trace(" Reference dropped: failed to find symbol {} from scope {}",name, ref_scope->get_full_path());
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion indexer/index_symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace diplomat::index

void IndexSymbol::add_reference(IndexRange ref_location)
{
spdlog::debug(" Add reference to {} : {}",_name,ref_location.start.to_string());
spdlog::trace(" Add reference to {} : {}",_name,ref_location.start.to_string());
_references_locations.insert(ref_location);
}

Expand Down
4 changes: 2 additions & 2 deletions indexer/index_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ namespace diplomat::index {

IndexSymbol* new_symb = _index->add_symbol(node.name,{stx->sourceRange(),*_sm}, slang::ast::toString(node.kind));
_current_scope()->add_symbol(new_symb);
spdlog::info("Added symbol with location {}.{} of kind {}",_current_scope()->get_full_path(),node.name,slang::ast::toString(node.kind));
spdlog::debug("Added symbol with location {}.{} of kind {}",_current_scope()->get_full_path(),node.name,slang::ast::toString(node.kind));
}
else
spdlog::info("Skipped symbol without def {}.{} of kind {}",_current_scope()->get_full_path(),node.name,slang::ast::toString(node.kind));
spdlog::debug("Skipped symbol without def {}.{} of kind {}",_current_scope()->get_full_path(),node.name,slang::ast::toString(node.kind));
}

visitDefault(node);
Expand Down

0 comments on commit 1a9c61f

Please sign in to comment.