File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
chimiddleware "github.com/go-chi/chi/v5/middleware"
13
13
"github.com/labstack/echo/v4"
14
14
"github.com/labstack/echo/v4/middleware"
15
+ "github.com/labstack/gommon/log"
15
16
16
17
"gitlab.unjx.de/flohoss/gocron/config"
17
18
"gitlab.unjx.de/flohoss/gocron/handlers"
@@ -35,7 +36,6 @@ func setupRouter() *echo.Echo {
35
36
e .HideBanner = true
36
37
e .HidePort = true
37
38
38
- e .Use (middleware .Logger ())
39
39
e .Use (middleware .Recover ())
40
40
e .Use (middleware .CORS ())
41
41
e .Use (middleware .GzipWithConfig (middleware.GzipConfig {
@@ -57,6 +57,12 @@ func main() {
57
57
}
58
58
59
59
e .Logger .SetLevel (env .GetLogLevel ())
60
+ if env .GetLogLevel () <= log .INFO {
61
+ e .Use (middleware .Logger ())
62
+ }
63
+ if env .GetLogLevel () == log .DEBUG {
64
+ e .Debug = true
65
+ }
60
66
61
67
cfg , err := config .New (configFolder + "config.yml" )
62
68
if err != nil {
You can’t perform that action at this time.
0 commit comments