Skip to content

Commit

Permalink
Merge pull request #99 from aws/make-new-NewLogWriter-public
Browse files Browse the repository at this point in the history
Change newLogWriter To NewLogWriter Making It Public
  • Loading branch information
sethAmazon authored Nov 3, 2023
2 parents 7629361 + 040f7c5 commit d2a4b9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
var prefixRegex = regexp.MustCompile("^[DIWE]!")

const (
LogTargetFile = "file"
LogTargetStderr = "stderr"
LogTargetFile = "file"
LogTargetStderr = "stderr"
LogTargetLumberjack = "lumberjack"
)

Expand Down Expand Up @@ -114,7 +114,7 @@ func newTelegrafWriter(w io.Writer, c LogConfig) (io.Writer, error) {

// SetupLogging configures the logging output.
func SetupLogging(cfg LogConfig) {
newLogWriter(cfg)
NewLogWriter(cfg)
}

type telegrafLogCreator struct {
Expand Down Expand Up @@ -149,7 +149,7 @@ func (t *telegrafLogCreator) CreateLogger(cfg LogConfig) (io.Writer, error) {
// It allows closing previous writer if re-set and have possibility to test what is actually set
var actualLogger io.Writer

func newLogWriter(cfg LogConfig) io.Writer {
func NewLogWriter(cfg LogConfig) io.Writer {
log.SetFlags(0)
if cfg.Debug {
wlog.SetLevel(wlog.DEBUG)
Expand Down Expand Up @@ -200,7 +200,7 @@ func (t *lumberjackLogCreator) CreateLogger(config LogConfig) (io.Writer, error)
}
// Writer will be created with timezone from config.log LogWithTimezone.
// Empty string will result in writer created with UTC.
w, err := newTelegrafWriter(writer,config)
w, err := newTelegrafWriter(writer, config)
if err != nil {
log.Fatalf("Error creating telegraf writer: %v", err)
}
Expand Down

0 comments on commit d2a4b9e

Please sign in to comment.