diff --git a/logger/logger.go b/logger/logger.go index db94442..4457ff9 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -3,6 +3,8 @@ package logger import ( "context" "errors" + "io/fs" + "syscall" "github.com/Trendyol/chaki/util/appctx" "go.uber.org/zap" @@ -45,7 +47,14 @@ func New() *zap.Logger { } func Sync() error { - return New().Sync() + err := New().Sync() + + var pathErr *fs.PathError + if errors.Is(err, syscall.ENOTTY) || errors.As(err, &pathErr) { + return nil + } + + return err } func From(ctx context.Context) *zap.Logger { diff --git a/option.go b/option.go index 2d590e0..0ce1c53 100644 --- a/option.go +++ b/option.go @@ -5,14 +5,14 @@ import ( ) type configOptions struct { - disabled bool - path string referencePaths map[string]string + path string + disabled bool } type options struct { - timeout time.Duration configOptions configOptions + timeout time.Duration } func getOptions(opt ...Option) *options {