"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/middlewares/accesslog/logger_formatters_test.go" between
traefik-v2.3.2.src.tar.gz and traefik-v2.3.3.src.tar.gz

About: Traefik is a cloud native edge router, a reverse proxy and load balancer for HTTP and TCP-based applications.

logger_formatters_test.go  (traefik-v2.3.2.src):logger_formatters_test.go  (traefik-v2.3.3.src)
skipping to change at line 63 skipping to change at line 63
OriginContentSize: 132, OriginContentSize: 132,
RequestRefererHeader: "referer", RequestRefererHeader: "referer",
RequestUserAgentHeader: "agent", RequestUserAgentHeader: "agent",
RequestCount: nil, RequestCount: nil,
RouterName: "foo", RouterName: "foo",
ServiceURL: "http://10.0.0.2/toto", ServiceURL: "http://10.0.0.2/toto",
}, },
expectedLog: `10.0.0.1 - Client [10/Nov/2009:23:00:00 +00 00] "GET /foo http" 123 132 "referer" "agent" - "foo" "http://10.0.0.2/toto" 123 000ms expectedLog: `10.0.0.1 - Client [10/Nov/2009:23:00:00 +00 00] "GET /foo http" 123 132 "referer" "agent" - "foo" "http://10.0.0.2/toto" 123 000ms
`, `,
}, },
/* {
{ name: "all data with local time",
name: "all data with local time", data: map[string]interface{}{
data: map[string]interface{}{ StartLocal: time.Date(2009, time.Nove
StartLocal: t mber, 10, 23, 0, 0, 0, time.UTC),
ime.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC), Duration: 123 * time.Second,
Duration: 1 ClientHost: "10.0.0.1",
23 * time.Second, ClientUsername: "Client",
ClientHost: " RequestMethod: http.MethodGet,
10.0.0.1", RequestPath: "/foo",
ClientUsername: " RequestProtocol: "http",
Client", OriginStatus: 123,
RequestMethod: h OriginContentSize: 132,
ttp.MethodGet, RequestRefererHeader: "referer",
RequestPath: " RequestUserAgentHeader: "agent",
/foo", RequestCount: nil,
RequestProtocol: " RouterName: "foo",
http", ServiceURL: "http://10.0.0.2/toto",
OriginStatus: 1 },
23, expectedLog: `10.0.0.1 - Client [10/Nov/2009:14:00:00 -09
OriginContentSize: 1 00] "GET /foo http" 123 132 "referer" "agent" - "foo" "http://10.0.0.2/toto" 123
32, 000ms
RequestRefererHeader: " `,
referer", },
RequestUserAgentHeader: "
agent",
RequestCount: n
il,
RouterName: "
foo",
ServiceURL: "
http://10.0.0.2/toto",
},
expectedLog: `10.0.0.1 - Client [
10/Nov/2009:14:00:00 -0900] "GET /foo http" 123 132 "referer" "agent" - "foo" "h
ttp://10.0.0.2/toto" 123000ms
`,
},
*/
} }
// Set timezone to Alaska to have a constant behavior // Set timezone to Etc/GMT+9 to have a constant behavior
os.Setenv("TZ", "US/Alaska") os.Setenv("TZ", "Etc/GMT+9")
for _, test := range testCases { for _, test := range testCases {
test := test test := test
t.Run(test.name, func(t *testing.T) { t.Run(test.name, func(t *testing.T) {
t.Parallel() t.Parallel()
entry := &logrus.Entry{Data: test.data} entry := &logrus.Entry{Data: test.data}
raw, err := clf.Format(entry) raw, err := clf.Format(entry)
assert.NoError(t, err) assert.NoError(t, err)
 End of changes. 2 change blocks. 
41 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)