-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Change logging so that the messages appear once on thread status change #36
Change logging so that the messages appear once on thread status change #36
Conversation
You reordered the functions so I can not really see what changed. Would you like to merge it like this or create two commits? |
thread.daemon = True | ||
thread.start() | ||
return thread | ||
def write_log(title, message=''): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this: It is a basis of setting a log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought somebody may want to replace this function with own implementation to write messages to another destination in another format.
Ok, no problem. I just found that we lost structure. |
4480fad
to
6b28e3a
Compare
I've changed the order back so that you can review the changes. I'll create another PR for with reordered functions then. |
# Gotcha! | ||
hanging_threads.add(thread_id) | ||
# Report the hanged thread. | ||
log_hanged_thread(thread_id, frame) | ||
old_threads = new_threads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to say that the monitor()
function becomes too large. However I have not found simple elegant way to divide it into small chunks. I think it should be rewritten in FP or OOP style. But this is probably a job for another task. For now I just want to make it usable for me and others to let us all fix the hanging threads problem in our apps :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can create an issue: refactor monitor function and an issue to write tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #21.