We don't plan on exposing the commonLogger implementation, but you can 
write your own handler to get the exact format you want.

See github.com/jba/slog/handlers for some existing code.
See https://github.com/golang/example/tree/master/slog-handler-guide for a 
guide to writing a slog handler.

On Saturday, July 22, 2023 at 9:22:42 AM UTC-4 cpu...@gmail.com wrote:

> Seems it's not possible to create a logger using the log.Logger format in 
> a straight-forward way?
>
> On Thursday, July 20, 2023 at 3:48:49 PM UTC+2 cpu...@gmail.com wrote:
>
>> The log/slog logger uses the log.Logger format by default. Implementation 
>> is internal.
>>
>> In a gradual switch to slog I'd like to keep that format for time being 
>> but customize other handler options- hence need to create a new Logger. Is 
>> there a good way to do that without reimplementing the entire internal slog 
>> logic around commonHandler etc?
>>
>> Cheers,
>> Andreas
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/74cd209a-60f6-4be0-969c-b48d0d5b5251n%40googlegroups.com.

Reply via email to