-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Log an INFO-level message when SIGINT received #946
Comments
@Makman2 To make it clear, this is all intended behavior. I kind of see your point, but it's probably not something that the library should spam into log files for users that collect them for later (if I'm making any sense). The issue is debatable, but since it's an event that clearly belongs to the "debugging" stage of application development, it makes sense to have it displayed only when debug logging is enabled, which every user should do at least once in his contact with ptb, since this offers many other clues to the internals of ptb that would fall into the same category of what the library does under the hood. |
This is the thing where I'm not so sure ;) It's kind of right that you usually keep your bot alive forever once it's in production state, however even then you sometimes have to shut it down (and I'm not sure if a production state bot should run in DEBUG mode). An indication might just help seeing that everything went fine.
Indeed :) Personally I would like to receive an info, that's why I try to find arguments for it :) |
@Eldinnie I Agree |
@jh0ker I agree too |
You got my blessing. @Makman2 would you be willing to make a PR? :) |
I'll try, currently Christmas and stuff, and Google Code-In still running on my main open source project :) But shouldn't be too hard I guess ;) |
Hi ;)
I'm recently experimenting with your nice bot. However, I stumbled upon this during my "learning-process":
I've created a bot, it worked normally. I just did
updater.start_polling
like in the examples, but without usingupdater.idle()
(I thought firststart_polling
is blocking). Exiting with CTRL+C worked immediately, but has thrown aKeyboardInterrupt
.After a while I found the
idle()
function, but I was actually a bit confused of CTRL+C's behaviour, because I've configured logging with a minimum level ofINFO
. So I've seen nothing when I pressed the keys. The bot actually needs a while to shutdown, and because nothing was logged I assumed the SIGINT signal wasn't received (/ assuming due to internal threading stuff not properly processed), so I pressed always CTRL+C two times causing a SIGTERM which worked immediately.SIGINT notifications are only visible when enabling
DEBUG
-level logging. I would suggest to add anINFO
message, that tells something likeReceived SIGINT, shutting down...
, so nobody is worried ;)The text was updated successfully, but these errors were encountered: