Skip to content

Commit 8a1de27

Browse files
committed
Fix CI
1 parent f75042d commit 8a1de27

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

go-json-server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ func main() {
127127

128128
func response(w http.ResponseWriter, r *http.Request) {
129129

130+
appLogger := logger.CreateLogger()
131+
130132
r.ParseForm()
131-
logger.AccessLog(r)
133+
appLogger.AccessLog(r)
132134

133135
w.Header().Set("Access-Control-Allow-Origin", "*")
134136
w.Header().Set("Access-Control-Allow-Credentials", "true")

src/logger/logger.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ func (l *stdLogger) AccessLog(r *http.Request) {
4040
writer.Flush()
4141
}
4242

43+
func (l *stdLogger) Printf(format string, args ...interface{}) {
44+
l.stdout.Printf(format, args...)
45+
}
46+
47+
func (l *stdLogger) Errorf(format string, args ...interface{}) {
48+
l.stderr.Printf(format, args...)
49+
}
50+
51+
func (l *stdLogger) Fatalf(format string, args ...interface{}) {
52+
l.stderr.Fatalf(format, args...)
53+
}
54+
4355
func dumpJsonBoddy(req *http.Request) string {
4456

4557
if req.Method == "GET" {
@@ -73,15 +85,3 @@ func dumpJsonBoddy(req *http.Request) string {
7385
s := fmt.Sprintf("%v", jsonBody)
7486
return s
7587
}
76-
77-
func (l *stdLogger) Printf(format string, args ...interface{}) {
78-
l.stdout.Printf(format, args...)
79-
}
80-
81-
func (l *stdLogger) Errorf(format string, args ...interface{}) {
82-
l.stderr.Printf(format, args...)
83-
}
84-
85-
func (l *stdLogger) Fatalf(format string, args ...interface{}) {
86-
l.stderr.Fatalf(format, args...)
87-
}

0 commit comments

Comments
 (0)