File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -127,8 +127,10 @@ func main() {
127127
128128func 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" )
Original file line number Diff line number Diff 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+
4355func 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- }
You can’t perform that action at this time.
0 commit comments