On Aug 18, 2014, at 9:14 AM, Roberto Polli <roberto.po...@babel.it> wrote:

> Hi @all,
> 
> On Tuesday 12 August 2014 11:18:31 Glyph Lefkowitz wrote:
>> 2- I'll create t.p.logger._syslog
>> 3- I''ll patch t.p.syslog to use  t.p.logger._syslog
> While writing 2, I found that
> 
> 1- t.p.logger.LogLevel implements a mapping between syslog priorities and 
> loglevels.

Yeah, I remember working on this and I was actually a little surprised we 
didn't take it further and implement syslog entirely.  So I'm glad you're 
working on this.

> 2- there's a private method which actually which doesn't seem to work as 
> expected (priorities order is reversed):

Sounds like that should be fixed!  Perhaps you could submit a ticket which was 
just this fix, to get something landed more quickly? :-).

>  * LogLevel._priorityForLevel(LogLevel.debug) == 0
>  * should be 7
> 3- To have a correct mapping we should add `kern` even if probably it's not a 
> value which fits to a python application.

Thoroughness in implementation of specifications is generally a virtue.

> 4- There's an old closed ticket on that, but it doesn't say anything about 
> loglevels but only an interesting discussion about NamedConstants

Link?  If you think that ticket ended up being about something else, you can 
always file a new one.  Thanks for looking it up first though, it's always good 
to avoid duplicates when we can.

> Q1- Should we implement a priority mapping in LogLevel?
> Q2- Should we fix that method and make it public?

It doesn't have to be public just because it's used by two parts of the log 
system implementation.  Public methods in Twisted are also considered 
"published"; it's usually better to call private methods internally than to 
expose a whole bunch of implementation details to application code which it can 
then start depending upon and making it impossible for us to fix without 
breaking the compatibility policy.

-glyph

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to