Hi,
Well, I do not know how I would do that. I have tried what you suggested,
like this:
fmt='%(str(asctime))s - %(message)s'
Which looks very strange to me, and does not work.
But thanks to your suggestion, I discovered a way to display all fields in
the log message:
fmt = '%s'
Which gives me:
{'name': 'pyjamas.logging', 'msg': 'my message: total=%d first=%d read=%d',
'args': (552, 0, 25), 'levelname': 'INFO', 'levelno': 20, 'pathname':
'__main__', 'filename': '__main__.py', 'module': '__main__', 'exc_info':
None, 'exc_text': None, 'lineno': 1, 'funcName': '(unknown function)',
'created': 1356905101.687, 'msecs': 687.000036239624, 'relativeCreated':
7493.99995803833, 'thread': None, 'threadName': None, 'process': None,
'message': 'my message: total=552 first=0 read=25'}
Which is very useful. That tells me that asctime is not supported. I will
use "created", which should be good enough for me.
So this is my fmt now:
fmt = '%(created)14.3f - %(message)s'
Thanks.
Daniel
On Sunday, December 30, 2012 10:39:35 PM UTC+1, istvan.vago wrote:
>
> Hi,
> try str(asctime)
> 2012.12.30. 21:52, "Daniel Gonzalez" <[email protected] <javascript:>>
> ezt írta:
>
>> Hi,
>>
>> I am trying to specifiy a custom fmt for getConsoleLogger. I have tried
>> with:
>>
>> '%(message)s'
>>
>> Which is working fine. But:
>>
>> '%(asctime)s - %(message)s'
>>
>> is giving the error:
>>
>> TypeError: converter() takes at most 1 argument (2 given)
>>
>> Is asctime not supported? How can I display timestamps in my logs?
>>
>> Thanks,
>> Daniel
>>
>> --
>>
>>
>>
>>
>
--