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

fix: Issue422 replace print with logging #543

Merged
merged 5 commits into from
Jul 27, 2022

Conversation

latika-wadhwa
Copy link
Contributor

@latika-wadhwa latika-wadhwa commented Jul 15, 2022

Close #419

@latika-wadhwa
Copy link
Contributor Author

/gcbrun

@latika-wadhwa
Copy link
Contributor Author

@nehanene15 Do let me know if you also want me to change print statements in test cases

print("-- ** Logging Target DF ** --")
print(target_df.dtypes)
print(target_df)
logging.info("-- ** Logging Source DF ** --")
Copy link
Collaborator

Choose a reason for hiding this comment

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

these seem like error logs

@@ -36,11 +37,11 @@ def print_formatted_(self, result_df):
:param result_df
"""
if self.format == "text":
print(result_df.to_string(index=False))
logging.info(result_df.to_string(index=False))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the logging change the nature of this printing (newlines might either split into new logs or be less exportable)

I think printing might be more logical here, but we need to maintain the ability to export into a file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think logging would split into new logs if it has \n in it.
https://stackoverflow.com/questions/22934616/multi-line-logging-in-python.
Do let me know if this makes sense to you

Copy link
Collaborator

Choose a reason for hiding this comment

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

It something I've seen in stackdriver specifically.

In any case, I'm more worried that you are changing the actual output here since this option is requesting a specific type to be output. CSV and json data would no longer be valid, so anyone piping these out to files would start seeing differences.

Copy link
Contributor Author

@latika-wadhwa latika-wadhwa Jul 20, 2022

Choose a reason for hiding this comment

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

That makes sense! Will update it

@latika-wadhwa latika-wadhwa merged commit 78222b4 into develop Jul 27, 2022
@latika-wadhwa latika-wadhwa deleted the issue422-replace-print-with-logging branch July 27, 2022 16:16
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.

Implement uniform logging
2 participants