Skip to content

Disable the log handlers for the stdout and output file. #598

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 28 commits into from
Dec 3, 2021

Conversation

MaxJPRey
Copy link
Collaborator

Disable the log handlers for the stdout and output file.
Add some unit tests to make sure the different log handlers are disable/re-enable properly.

Fix #587.

@MaxJPRey MaxJPRey changed the title Disable the log handlers for the stdout and output file. [WIP] Disable the log handlers for the stdout and output file. Nov 21, 2021
@MaxJPRey MaxJPRey marked this pull request as draft November 21, 2021 13:48
@akaszynski
Copy link
Contributor

FYI, since we can now mark draft requests for private and public PRs due to our upgrade to the enterprise account, we can now stop using [WIP].

@MaxJPRey
Copy link
Collaborator Author

MaxJPRey commented Nov 22, 2021

FYI, since we can now mark draft requests for private and public PRs due to our upgrade to the enterprise account, we can now stop using [WIP].

@akaszynski Ok, I was tagging with both "draft" and "WIP". I will just use the the draft feature from now on.

@MaxJPRey MaxJPRey changed the title [WIP] Disable the log handlers for the stdout and output file. Disable the log handlers for the stdout and output file. Nov 22, 2021
@MaxJPRey MaxJPRey marked this pull request as ready for review November 22, 2021 19:49
@MaxJPRey MaxJPRey marked this pull request as draft November 22, 2021 19:51
@MaxJPRey MaxJPRey requested a review from maxcapodi78 November 23, 2021 17:09
@MaxJPRey MaxJPRey marked this pull request as ready for review November 23, 2021 17:09
def test_04_disable_output_file_handler(self):
content = None
temp_dir = tempfile.gettempdir()
path = os.path.join(temp_dir, "test04.txt")
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this file removed?

have you considered NamedTemporaryFile ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have to use gettempdir because otherwise with NamedTemporaryFile, I cannot read the file latter on because it is deleted as soon as I closed it.
The temp dir and all its content will be deleted at the end of the test to be sure that no handlers is preventing from this operation. Thanks for the reminder.

Copy link
Collaborator

@maxcapodi78 maxcapodi78 left a comment

Choose a reason for hiding this comment

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

LGTM

@MaxJPRey MaxJPRey merged commit 6bf56d4 into main Dec 3, 2021
@MaxJPRey MaxJPRey deleted the fix/issue_587 branch December 3, 2021 14:12
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.

Logger Improvements
4 participants