[Twisted-Python] patch for t.p.logger.SyslogObserver (was #7549)
Hi everybody, I found some time for adding a stub of SyslogObserver to the new t.p.logger. https://github.com/ioggstream/twisted/commit/991156e1124d61ad26da0be12123079... Feedback welcome! Peace, R. -- Roberto Polli Community Manager Babel - a business unit of Par-Tec S.p.A. - http://www.babel.it T: +39.06.9826.9651 M: +39.340.652.2736 F: +39.06.9826.9680 P.zza S.Benedetto da Norcia, 33 - 00040 Pomezia (Roma) CONFIDENZIALE: Questo messaggio ed i suoi allegati sono di carattere confidenziale per i destinatari in indirizzo. E' vietato l'inoltro non autorizzato a destinatari diversi da quelli indicati nel messaggio originale. Se ricevuto per errore, l'uso del contenuto e' proibito; si prega di comunicarlo al mittente e cancellarlo immediatamente.
On Aug 18, 2014, at 10:50 AM, Roberto Polli <roberto.polli@babel.it> wrote:
Hi everybody,
I found some time for adding a stub of SyslogObserver to the new t.p.logger.
https://github.com/ioggstream/twisted/commit/991156e1124d61ad26da0be12123079...
Feedback welcome!
Peace, R.
For starters, DummyFile looks unnecessary. You've got tests that make sure it isn't written to, but you just construct one and you don't pass it to anything, so of course it doesn't get written to, why would it? This is the sort of test one might write if one were writing tests after the fact, rather than test-driven as Twisted's process recommends. You weren't writing tests last, were you? ;-) It also looks like the sort of thing you copied and pasted out of test_file.py. Please don't copy and paste; if you want to import a helper from elsewhere in the test suite, just import it. Is this otherwise ready for review? -glyph
Hi Glyph, thx for your feedback! > Is this otherwise ready for review? Not ready for review: there's even to check the interoperability with twistd ;) I was concerned about to be on the right track, eg: 1- is it fine to patch SyslogObserver.syslog or should I pass it as a parameter to SyslogObserver(...,syslog=stdsyslog.syslog)? 2- should syslog severity be implemented _syslog.py or in LogLevels On Monday 18 August 2014 12:19:11 Glyph Lefkowitz wrote: > > ..a stub of SyslogObserver to the new t.p.logger. > > > > https://github.com/ioggstream/twisted/commit/991156e1124d61ad26da0be121230 > > 79ffc45764c > ...DummyFile looks unnecessary. > you copied and pasted out of test_file.py. As I didn't know how the new logger worked, I started duplicating: * _file.py -> _syslog.py * test_file.py -> test_syslog.py And merging t.p.test.test_syslog behavior into test_syslog. > You weren't writing tests last, were you? ;-) Nope :) Iteratively modifying test_syslog.py then _syslog.py so that I could get in touch with the new logger. Thx again for all your time + Peace, R. -- Roberto Polli Community Manager Babel - a business unit of Par-Tec S.p.A. - http://www.babel.it T: +39.06.9826.9651 M: +39.340.652.2736 F: +39.06.9826.9680 P.zza S.Benedetto da Norcia, 33 - 00040 Pomezia (Roma)
Hi Glyph|all, I just noticed the t.p.logger is gone (or integrated). This made the patch for supporting logLevels in t.p.syslog straightforward: https://twistedmatrix.com/trac/attachment/ticket/7549/syslog-loglevels-7549.... There are plenty of tests and it worked nicely on my env, allowing rsyslog to split my twistd app log in various files with different priorities. If you see some flaw in the tests just let me know... once I roll it for a while on my apps I'll put the ticket in review. Sorry for the great delay :( Peace, R. -- Roberto Polli
On Dec 3, 2014, at 22:55, Roberto Polli <roberto.polli@babel.it> wrote:
Hi Glyph|all,
I just noticed the t.p.logger is gone (or integrated). This made the patch for supporting logLevels in t.p.syslog straightforward:
It's not dead, it's just... resting. More details here: <http://twistedmatrix.com/trac/milestone/New%20Logging%20System <http://twistedmatrix.com/trac/milestone/New%20Logging%20System>>
https://twistedmatrix.com/trac/attachment/ticket/7549/syslog-loglevels-7549....
There are plenty of tests and it worked nicely on my env, allowing rsyslog to split my twistd app log in various files with different priorities.
If you see some flaw in the tests just let me know... once I roll it for a while on my apps I'll put the ticket in review.
Sorry for the great delay :(
Thanks for your contribution! I'll probably only look at the tests once it's in review, though ;). -glyph
On Thursday 04 December 2014 21:27:46 Glyph wrote:
Thanks for your contribution! I'll probably only look at the tests once it's in review, though ;). Ok, I'll search in list if there's somebody interested in trying the patch...
Peace, R. -- Roberto Polli Community Manager Babel - a business unit of Par-Tec S.p.A. - http://www.babel.it T: +39.06.9826.9651 M: +39.340.652.2736 F: +39.06.9826.9680 P.zza S.Benedetto da Norcia, 33 - 00040 Pomezia (Roma) CONFIDENZIALE: Questo messaggio ed i suoi allegati sono di carattere confidenziale per i destinatari in indirizzo. E' vietato l'inoltro non autorizzato a destinatari diversi da quelli indicati nel messaggio originale. Se ricevuto per errore, l'uso del contenuto e' proibito; si prega di comunicarlo al mittente e cancellarlo immediatamente.
participants (3)
-
Glyph
-
Glyph Lefkowitz
-
Roberto Polli