diff --git a/options.go b/options.go index 8737d7d..b620d48 100644 --- a/options.go +++ b/options.go @@ -58,4 +58,6 @@ type Options struct { Fields []interface{} // Formatter is the formatter for the logger. The default is TextFormatter. Formatter Formatter + // Styles is the logger styles for the TextFormatter. + Styles *Styles } diff --git a/pkg.go b/pkg.go index 9e083a3..80e9360 100644 --- a/pkg.go +++ b/pkg.go @@ -66,7 +66,7 @@ func NewWithOptions(w io.Writer, o Options) *Logger { l.SetOutput(w) l.SetLevel(Level(l.level)) - l.SetStyles(DefaultStyles()) + l.SetStyles(o.Styles) if l.callerFormatter == nil { l.callerFormatter = ShortCallerFormatter