> On May 24, 2016, at 4:10 PM, Daniel Sutcliffe <dan...@gmail.com> wrote:
> 
>> The main reason I wanted to do the format-string translation is that it 
>> would allow the key/value pairs to be stored according to the same idiom 
>> that Twisted uses, and therefore be serialized to jsonFileLogObserver and 
>> consequently things like LogStash / ElasticSearch.
> 
> I kept the format-string args within a dictionary under the args kwarg
> to emit() for exactly the reasons you gave above but felt that
> translating a %-encoded string into the new-style that twisted.logger
> uses was likely to make the example much more complicated, and was
> frankly beyond my limited needs. There's probably a simple way to do
> this in Python that I am not aware of yet though...

I wrote a function to do this some time ago, and I forget the exact derivation, 
but somehow it ended up here:

https://github.com/moreati/formatist

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

Reply via email to