This example
// Create lgr logger
lgrLogger := lgr.New(lgr.Debug, lgr.Msec)
// Convert to slog handler and create slog logger
handler := lgr.ToSlogHandler(lgrLogger)
logger := slog.New(handler)
// Use standard slog API with lgr formatting
logger.Info("message", "key1", "value1")
// Output: 2023/09/15 10:34:56.789 INFO message key1="value1"
actually outputs time & level twice:
// Output: 2023/09/15 10:34:56.789 INFO 2023/09/15 10:34:56.789 INFO message key1="value1"
If you log at DEBUG level, than you get INFO & DEBUG levels at once:
logger.Debug("message", "key1", "value1")
// Output: 2023/09/15 10:34:56.789 INFO 2023/09/15 10:34:56.789 DEBUG message key1="value1"
I suggest to remove this lines completely.
This example
actually outputs time & level twice:
// Output: 2023/09/15 10:34:56.789 INFO 2023/09/15 10:34:56.789 INFO message key1="value1"If you log at DEBUG level, than you get INFO & DEBUG levels at once:
I suggest to remove this lines completely.