package kniblog import ( "io" "git.int.kn/ibdev_go/knib-lib-gologger/pkg/logformatter" "github.com/rs/zerolog" ) var Logger *zerolog.Logger var writeClosersZerolog []io.WriteCloser func LogSetupZerolog(logLevel int8, writers []io.Writer, writeClosers []io.WriteCloser) error { allWriters := writers for _, wrc := range writeClosers { wr := wrc.(io.Writer) allWriters = append(allWriters, wr) } writeClosersZerolog = writeClosers instance, err := logformatter.NewZerologInstance(logLevel, allWriters...) Logger = &instance return err } func LogStopZerolog() []error { errorsOccured := []error{} for _, wrc := range writeClosersZerolog { err := wrc.Close() if err != nil { errorsOccured = append(errorsOccured, err) } } Logger = nil return errorsOccured }