We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 092457b commit 3d2f39dCopy full SHA for 3d2f39d
log/log.go
@@ -77,10 +77,11 @@ func init() {
77
}
78
79
type Options struct {
80
- Context context.Context
81
- LogLevel Level
82
- Sync bool
83
- Location *time.Location
+ Context context.Context
+ LogLevel Level
+ Sync bool
+ ForceColor bool
84
+ Location *time.Location
85
86
87
// Initialize the Logger
@@ -90,6 +91,10 @@ func Init(opts *Options) error {
90
91
92
93
formatter := newTimeZoneFormatter(opts.Location)
94
+ if opts.ForceColor {
95
+ formatter.formatter.ForceColors = true
96
+ formatter.formatter.DisableColors = false
97
+ }
98
99
// Create new logger
100
logger := logrus.New()
0 commit comments