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

Implement TraceFunctionCall; replace Tracef #146

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bitkeks
Copy link
Collaborator

@bitkeks bitkeks commented Dec 19, 2023

Implements the TraceFunctionCall function in 'utils.go'.

All 'log.Tracef()' calls are replaced with the new function.

Refs #138
See: #138 (comment)

Implements the TraceFunctionCall function in 'utils.go'.
All 'log.Tracef()' calls in foreman/api were replaced by the
new trace function.

Refs terraform-coop#138
terraform-coop#138 (comment)

Signed-off-by: Dominik Pataky <[email protected]>
Both functions wrap the log.* functions, adding the filename and line
number of the calling function. Uses a switch to determine the final
log.* function that is called.

jobtemplate and template_input were refactored to use 'Debugf' instead
of 'Debug'. For testing, domain.go was also refactored to use utils.*
instead of log.*.

Signed-off-by: Dominik Pataky <[email protected]>
Also removes the dependency on HanseMerkur/terraform-provider-utils/log
in many files.

Signed-off-by: Dominik Pataky <[email protected]>
Completes the refactoring from log.* to utils.* for better debugging
output during provider runtime.

Signed-off-by: Dominik Pataky <[email protected]>
@bitkeks bitkeks marked this pull request as ready for review December 20, 2023 10:00
@bitkeks bitkeks requested a review from lhw December 20, 2023 10:00
@bitkeks
Copy link
Collaborator Author

bitkeks commented Dec 20, 2023

Refactoring is complete. All log.* calls were replaced to use the new utils.* log functions.

This allows for a better debug output for users which have no code editor or debuggers at hand.

During the refactoring I also fixed some other small issues like typos, formatting or flows. Nothing regarding any logic was changed though, so no user-side changes or errors are to be expected.

Copy link
Contributor

@lhw lhw left a comment

Choose a reason for hiding this comment

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

This might lead to conflicts with merging the other PRs. If you need another approval just ping me.

@bitkeks
Copy link
Collaborator Author

bitkeks commented Jan 29, 2024

This merge didn't work, will look into it later this week. It's mainly cosmetic refactoring, so no new features are blocked for now.

@lhw lhw marked this pull request as draft June 8, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants