Skip to content

Swift: add more debug logs #19384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged

Swift: add more debug logs #19384

merged 2 commits into from
Apr 25, 2025

Conversation

redsun82
Copy link
Contributor

No description provided.

@Copilot Copilot AI review requested due to automatic review settings April 25, 2025 13:21
@redsun82 redsun82 requested a review from a team as a code owner April 25, 2025 13:21
@github-actions github-actions bot added the Swift label Apr 25, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds additional debug log statements to improve the traceability of the Swift extractor's operation. Key changes include:

  • New LOG_DEBUG calls in the Observer class methods (main.cpp) to log function invocation.
  • Additional LOG_DEBUG messages in SwiftExtractor.cpp to report module loading and processing activities.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
swift/extractor/main.cpp Added debug logs in parsedArgs, configuredCompiler, performedCompilation, and markSuccessfullyExtractedFiles methods.
swift/extractor/SwiftExtractor.cpp Added debug logs for module loading count and for decisions to skip or process modules.

codeql::extractSwiftFiles(state, compiler);
codeql::extractSwiftInvocation(state, compiler, invocationTrap);
codeql::extractExtractLazyDeclarations(state, compiler);
}

void markSuccessfullyExtractedFiles() {
LOG_DEBUG("{}()", __func__);
Copy link
Preview

Copilot AI Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider standardizing the log message format across Observer methods. For example, if most methods use "{}(...)", you might adjust this log to match for consistency.

Suggested change
LOG_DEBUG("{}()", __func__);
LOG_DEBUG("{}(...)", __func__);

Copilot uses AI. Check for mistakes.

jketema
jketema previously approved these changes Apr 25, 2025
Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The Copilot suggestion makes sense to me, so maybe apply it?

@redsun82 redsun82 merged commit 46fb041 into main Apr 25, 2025
15 checks passed
@redsun82 redsun82 deleted the redsun82/swift-add-logs branch April 25, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants