Skip to content
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

Improve verbose logging by logging the workspace, project, and workspace transformations #5905

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

pepicrft
Copy link
Contributor

@pepicrft pepicrft commented Feb 9, 2024

Short description πŸ“

I'm proposing a couple of improvements to our logging strategy:

  • I removed all the debug logs in file handler. They are too level and fill the terminal with non-relevant noise like "writing file at path X".
  • I added debug logs at the mappers level. This is indeed more useful because we can see the series of transformations a project, workspace, or graph goes through, and we can spot if one gets stuck or takes more time that usual.

How to test the changes locally 🧐

If you run it against a project with --verbose you should see the new logs.

Contributor checklist βœ…

  • The code has been linted using run mise run lint:fix
  • The change is tested via unit testing or acceptance testing, or both
  • The title of the PR is formulated in a way that is usable as a changelog entry
  • In case the PR introduces changes that affect users, the documentation has been updated

Reviewer checklist βœ…

  • The code architecture and patterns are consistent with the rest of the codebase
  • Reviewer has checked that, if needed, the PR includes the label changelog:added, changelog:fixed, or changelog:changed, and the title is usable as a changelog entry

@pepicrft pepicrft self-assigned this Feb 9, 2024
@danieleformichelli danieleformichelli added the changelog:changed PR will be listed in the Changed section of CHANGELOG label Feb 9, 2024
@@ -12,6 +12,8 @@ public final class SourceRootPathProjectMapper: ProjectMapping {
public init() {}

public func map(project: Project) throws -> (Project, [SideEffectDescriptor]) {
logger.debug("Transforming project \(project.name): Setting $SRCROOT to \(project.name)")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
logger.debug("Transforming project \(project.name): Setting $SRCROOT to \(project.name)")
logger.debug("Transforming project \(project.name): Setting $SRCROOT to \(project.sourceRootPath.pathString)")

@pepicrft pepicrft merged commit 52acdb8 into main Feb 12, 2024
8 checks passed
@pepicrft pepicrft deleted the improve-logging branch February 12, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:changed PR will be listed in the Changed section of CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants