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

[issue-441] replace print() with logging #494

Merged

Conversation

armintaenzertng
Copy link
Collaborator

fixes #441

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Copy link
Collaborator

@meretp meretp left a comment

Choose a reason for hiding this comment

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

Your changes look good to me. I found two additional places in the codebase where information should bel logged. As I can't comment on unchanged lines, I reference them here:

Within the parser I also implemented a Logger- class, I didn't look in the documentation for the logging package but do you know if we could merge this somehow? So does the logging package provide any options for an individual logger? Although I am not sure if we would mix different levels of logging when merging this.

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
@armintaenzertng
Copy link
Collaborator Author

I fixed the system exits' logs, but for the cli tool parser the output is the actual wanted result of the tool and should therefore go to stdout, I think.

Copy link
Collaborator

@meretp meretp left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my remark and I agree that the output is wanted as is.
Do you have any thoughts on my last question concerning an indiviual logger?

@armintaenzertng
Copy link
Collaborator Author

armintaenzertng commented Feb 28, 2023

Concerning the parsing logger, which basically just collects all parsing errors, I think that it is still valid as it is to give helpful information for the SpdxParsingError that we raise (this can be caught by library users, which can easily do whatever they want with the get_messages() function).
The question would be if we additionally want to separately log all these errors. But right now, I don't see the merit in that.

@armintaenzertng armintaenzertng merged commit 7a6ee59 into spdx:refactor-python-tools Feb 28, 2023
@armintaenzertng armintaenzertng deleted the useLogging branch February 28, 2023 07:53
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.

None yet

2 participants