Log initializer for golang's slog. If terminal is detected, it will use colorized output else it will use JSON output.
go get github.com/rakunlabs/logi
logi.InitializeLog()
slog.Error("This is an error message")
slog.Info("Yet another log message")
For setting global log level, uses level parse from slog package.
logi.SetLogLevel("ERROR")
Context logging
ctx := logi.WithContext(context.Background(), slog.With(slog.String("component", "example")))
logi.Ctx(ctx).Info("This is a log message")