Thanks for response.
Should I prepare some PR now?
Generally I think about implementing `.uses_server_time()` using 
`_style.asctime_search` attribute:

 `self._fmt.find(self._style.asctime_search.replace('asctime', 
'server_time')) >=  0`

this call of `str.replace()` can be done even only once in 
`ServerFormatter.__init__()`.

W dniu sobota, 9 lutego 2019 00:11:03 UTC+1 użytkownik Tim Graham napisał:
>
> I'm not opposed to a patch to address your use case.
>
> On Thursday, February 7, 2019 at 6:34:23 AM UTC-5, Łukasz Skarżyński wrote:
>>
>> Hello,
>>
>> I encountered some troubles with django logging configuration during the 
>> update from Django 1.11 to 2.1. This issue was related to this commit 
>> <https://github.com/django/django/commit/3af305e8b8a89f4b0e5874cd601568ab8dcd7334>
>>  and 
>> generally `ServerFormatter.uses_server_time()` method. 
>> This method forces users to use `{` logging style, by hard coding it in 
>> the following line: `return self._fmt.find('{server_time}') >= 0`, so it 
>> works only with `{` style, which is the default one.
>> I couldn't find any explanation why users should use `{` style instead of 
>> `%` or `$` and I think style should be totally irrelevant to Django.
>> My suggestion is to make `ServerFormatter.uses_server_time()` workable 
>> with all logging styles or to add some note to documentation that `{` 
>> logging style must be used when `ServerFormatter` is overwritten.
>> If you decide to make some changes in relation to this issue, I am eager 
>> to contribute.
>>
>> Thank you all for working on Django!
>>
>> Kind Regards,
>> Łukasz
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/fd57a176-7614-4d43-972d-4faf8b9b5cca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to