Skip to content

Commit

Permalink
feat: New helper function for building the logger config.
Browse files Browse the repository at this point in the history
NewConsoleLoggerConfig() function returns a logger configuration for a
logger that logs to stdout with the maximum logging level set to Info.
  • Loading branch information
Tuxdude committed Feb 21, 2022
1 parent 61b4042 commit d2f2bd0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions zzzlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package zzzlog

import (
"io"
"os"

"github.com/tuxdude/zzzlogi"
)
Expand Down Expand Up @@ -42,3 +43,12 @@ func NewLogger(userConfig *Config) zzzlogi.Logger {
c.maxLevel = userConfig.MaxLevel
return newLoggerForConfig(c)
}

// NewConsoleLoggerConfig returns a logger configuration for
// logging to stdout with the maximum logging level set to Info.
func NewConsoleLoggerConfig() *Config {
return &Config{
Dest: os.Stdout,
MaxLevel: LvlInfo,
}
}

0 comments on commit d2f2bd0

Please sign in to comment.