@@ -13,10 +13,6 @@ import (
1313 "github.com/labstack/gommon/log"
1414)
1515
16- var (
17- env = os .Getenv ("ENV" )
18- )
19-
2016// ContextHandler is our base context handler, it will handle all requests
2117type ContextHandler struct {
2218 slog.Handler
@@ -144,7 +140,7 @@ func Replacer(groups []string, a slog.Attr) slog.Attr {
144140}
145141
146142func Errorf (ctx context.Context , format string , args ... interface {}) {
147- if env == "dev" {
143+ if os . Getenv ( "ENV" ) == "dev" {
148144 log .Errorf (format , args ... )
149145 return
150146 }
@@ -153,7 +149,7 @@ func Errorf(ctx context.Context, format string, args ...interface{}) {
153149}
154150
155151func Infof (ctx context.Context , format string , args ... interface {}) {
156- if env == "dev" {
152+ if os . Getenv ( "ENV" ) == "dev" {
157153 log .Infof (format , args ... )
158154 return
159155 }
@@ -162,7 +158,7 @@ func Infof(ctx context.Context, format string, args ...interface{}) {
162158}
163159
164160func Warnf (ctx context.Context , format string , args ... interface {}) {
165- if env == "dev" {
161+ if os . Getenv ( "ENV" ) == "dev" {
166162 log .Warnf (format , args ... )
167163 return
168164 }
@@ -171,7 +167,7 @@ func Warnf(ctx context.Context, format string, args ...interface{}) {
171167}
172168
173169func Debugf (ctx context.Context , format string , args ... interface {}) {
174- if env == "dev" {
170+ if os . Getenv ( "ENV" ) == "dev" {
175171 log .Debugf (format , args ... )
176172 return
177173 }
0 commit comments