File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 54
54
// Optional. Default value DefaultLoggerConfig.CustomTimeFormat.
55
55
CustomTimeFormat string `yaml:"custom_time_format"`
56
56
57
+ // Optional. Default value false.
58
+ NoColor bool `yaml:"no_color"`
59
+
57
60
// Output is a writer where logs in JSON format are written.
58
61
// Optional. Default value os.Stdout.
59
62
Output io.Writer
@@ -99,6 +102,9 @@ func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc {
99
102
config .template = fasttemplate .New (config .Format , "${" , "}" )
100
103
config .colorer = color .New ()
101
104
config .colorer .SetOutput (config .Output )
105
+ if config .NoColor {
106
+ config .colorer .Disable ()
107
+ }
102
108
config .pool = & sync.Pool {
103
109
New : func () interface {} {
104
110
return bytes .NewBuffer (make ([]byte , 256 ))
You can’t perform that action at this time.
0 commit comments