diff --git a/global.go b/global.go index 1440d67..97c3270 100644 --- a/global.go +++ b/global.go @@ -12,7 +12,6 @@ import ( //nolint:gochecknoglobals,gomnd var global = With(New(), WithTime(KeyTime, time.RFC3339), - WithSource(2, TrimPath), WithLevel(KeyLevel, level.Debug), WithExit(level.Alert), WithPanic(level.Emergency), diff --git a/handler/logrus/logger.go b/handler/logrus/logger.go index 7059a91..c042793 100644 --- a/handler/logrus/logger.go +++ b/handler/logrus/logger.go @@ -11,11 +11,13 @@ import ( ) // Standard create new standart logrus handler. +// Deprecated: delete after 0.7.0 func Standard() log.Logger { return New(logrus.StandardLogger()) } // New create new logrus handler. +// Deprecated: delete after 0.7.0 func New(log *logrus.Logger) log.Logger { return func(ctx context.Context, data *entry.Entry) (int, error) { lrgFields := make(logrus.Fields, data.Fields().Len()) diff --git a/handler/otel/logger.go b/handler/otel/logger.go index ba256f1..fbfdd33 100644 --- a/handler/otel/logger.go +++ b/handler/otel/logger.go @@ -7,6 +7,7 @@ import ( "gitoa.ru/go-4devs/log/entry" ) +// Deprecated: delete after 0.7.0 func New() log.Logger { return func(ctx context.Context, e *entry.Entry) (int, error) { addEvent(ctx, e) diff --git a/handler/otel/middleware.go b/handler/otel/middleware.go index 7b7be1d..19e0488 100644 --- a/handler/otel/middleware.go +++ b/handler/otel/middleware.go @@ -7,6 +7,7 @@ import ( "gitoa.ru/go-4devs/log/entry" ) +// Deprecated: delete after 0.7.0 func Middleware() log.Middleware { return func(ctx context.Context, e *entry.Entry, handler log.Logger) (int, error) { addEvent(ctx, e) diff --git a/handler/zap/logger.go b/handler/zap/logger.go index 8cb3bd6..56a415e 100644 --- a/handler/zap/logger.go +++ b/handler/zap/logger.go @@ -10,14 +10,17 @@ import ( "go.uber.org/zap" ) +// Deprecated: delete after 0.7.0 func Nop() log.Logger { return New(zap.NewNop()) } +// Deprecated: delete after 0.7.0 func Example(options ...zap.Option) log.Logger { return New(zap.NewExample(options...)) } +// Deprecated: delete after 0.7.0 func Production(options ...zap.Option) log.Logger { z, err := zap.NewProduction(options...) if err != nil { @@ -27,6 +30,7 @@ func Production(options ...zap.Option) log.Logger { return New(z) } +// Deprecated: delete after 0.7.0 func Development(options ...zap.Option) log.Logger { z, err := zap.NewDevelopment(options...) if err != nil { diff --git a/writer_example_test.go b/writer_example_test.go index 333a062..f54188b 100644 --- a/writer_example_test.go +++ b/writer_example_test.go @@ -22,7 +22,7 @@ func ExampleFormatWithBracket() { ctx := context.Background() logger := log.New(log.WithFormat(log.FormatWithBracket()), log.WithStdout()).With( log.WithSource(10, filepath.Base), - exampleWithTime(log.KeyTime, time.RFC3339), //log.WithTime(log.KeyTime, time.RFC3339), + log.WithLevel(log.KeyLevel, level.Info), )