[Twisted-Python] Getting started on making the move to the new logging system
Hi everyone! I have gone through < http://twisted.readthedocs.org/en/latest/core/howto/logging.html> and < http://twisted.readthedocs.org/en/latest/core/howto/logger.html>. And I want to get started helping out with making the move to the new logging system. I talked to Glyph and ralphm about this at the PyCon sprints. The main purpose of this email is that I would like some advice as to how to move forward. Are there any other docs that I should read? Also, where should I start? What should be the scope of each individual ticket? I was talking to adiroiban and hawkowl on IRC about this, and they also recommended that I send an email to the mailing list before getting started, so here I am. I would really appreciate it if you could give me some advice and guidance regarding this. :-) Thanks, Eeshan Garg
On Apr 27, 2015, at 10:57 AM, Eeshan Garg <jerryguitarist@gmail.com> wrote:
Hi everyone!
I have gone through <http://twisted.readthedocs.org/en/latest/core/howto/logging.html <http://twisted.readthedocs.org/en/latest/core/howto/logging.html>> and <http://twisted.readthedocs.org/en/latest/core/howto/logger.html <http://twisted.readthedocs.org/en/latest/core/howto/logger.html>>. And I want to get started helping out with making the move to the new logging system.
I talked to Glyph and ralphm about this at the PyCon sprints. The main purpose of this email is that I would like some advice as to how to move forward. Are there any other docs that I should read? Also, where should I start? What should be the scope of each individual ticket?
My initial suggestion - don't take this too authoritatively, I'd be happy for input from anyone else - would be that the next step would be to simply identify a module that has some interesting log events, make a ticket for logging them using the new system, and then write a patch for that ticket. The scope of each ticket should be as small as possible, given that small tickets get through review faster. Keep in mind though that there is probably insufficient test coverage for log statements as it is, so you'll almost certainly have to add tests which assert things about the new messages even if the logging statements themselves were covered by HTTP/1.1. One good place to start would either be in twisted.web, or in some of the "core" logging messages we see all of the time, like twisted.internet.protocol.Factory.doStart. Right now the only way to control that particular message is to set the 'noisy' attribute on Factory, but the new logging system has an explicit filtering step which can start to provide better support for controlling chatty subsystems. Another thing to keep an eye on as you do this is to make sure that you convert any string-formatting you find in log messages - like, for example, the '"Starting factory %r" % self' in the message I referenced - and replace it with structured formatting, like self.logger.info("Starting factory {self}").
I was talking to adiroiban and hawkowl on IRC about this, and they also recommended that I send an email to the mailing list before getting started, so here I am. I would really appreciate it if you could give me some advice and guidance regarding this. :-)
Sounds like good advice. Good luck, and feel free to keep asking questions, -glyph
Hello, Glyph! :-)
My initial suggestion - don't take this too authoritatively, I'd be happy for input from anyone else - would be that the next step would be to simply identify a module that has some interesting log events, make a ticket for logging them using the new system, and then write a patch for that ticket.
There is a possibility that I misunderstood what you had actually meant, but I assure you that I was not being or even trying to be authoritative, however, if it seemed like I was, I sincerely apologize. Also, if you felt inclined to point this out to me, then it probably means it is another one of those things about myself that I need to work on and rectify. :-) Also, I'd be more than glad for input from anyone else as well. I did not intend for this email to be addressed exclusively to one or two person(s), however, if it seemed like that, again I apologize. And I'll make sure these things don't happen again. :-) One more thing I would like to say, when I said "advice and guidance regarding this" below: I was talking to adiroiban and hawkowl on IRC about this, and they also recommended that I send an email to the mailing list before getting started, so here I am. I would really appreciate it if you could give me some advice and guidance regarding this. :-)
Sounds like good advice.
Good luck, and feel free to keep asking questions,
-glyph
"regarding this" in that sentence refers to guidance and advice regarding all of my questions that I had asked in the previous paragraph; these words did not imply that I needed guidance regarding what hawkowl and adiroiban had already advised me to do. But now when I go back and read my initial email, I admit that my first email could have been more well-structured and I can see gaping holes in my structure of writing and writing in general that I plan on improving. ;-) Warm regards, Eeshan Garg
On Apr 27, 2015, at 9:12 PM, Eeshan Garg <jerryguitarist@gmail.com> wrote:
Hello, Glyph! :-)
My initial suggestion - don't take this too authoritatively, I'd be happy for input from anyone else - would be that the next step would be to simply identify a module that has some interesting log events, make a ticket for logging them using the new system, and then write a patch for that ticket.
There is a possibility that I misunderstood what you had actually meant, but I assure you that I was not being or even trying to be authoritative,
I just meant don't take my comments too authoritatively :-).
One more thing I would like to say, when I said "advice and guidance regarding this" below:
...
Sounds like good advice.
Good luck, and feel free to keep asking questions,
-glyph
And I just meant "it sounds like HawkOwl and adiroiban gave you good advice by telling you to ask for advice on the mailing list" :-). Hope that's clearer, -g
Hi Glyph! My apologies for misunderstanding! I'll try my best and make sure that does not happen again. I am counting on you and the members of this community to be severely critical of me if I go down a path that I should not be taking, and this community can count on me in the sense that I'll invariably admit it when I screw up and try my best to rectify my mistakes and improve my conduct accordingly! :-) I'll get started on the logging thing and I'll send an email to the mailing list if I have any questions. :-) Warm regards, Eeshan Garg
participants (2)
-
Eeshan Garg
-
Glyph Lefkowitz