Codebase list golang-github-go-kit-kit / dd5564d
Merge pull request #138 from juRiii/master log: Fix StdlibAdapter parsing of Windows file paths when stdlib log has the Llongfile flag set. Chris Hines 8 years ago
2 changed file(s) with 32 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
9494 const (
9595 logRegexpDate = `(?P<date>[0-9]{4}/[0-9]{2}/[0-9]{2})?[ ]?`
9696 logRegexpTime = `(?P<time>[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?)?[ ]?`
97 logRegexpFile = `(?P<file>[^:]+:[0-9]+)?`
97 logRegexpFile = `(?P<file>.+:[0-9]+)?`
9898 logRegexpMsg = `(: )?(?P<msg>.*)`
9999 )
100100
133133 "file": "/a/b/c/d.go:23",
134134 "msg": "hello world",
135135 },
136 "2009/01/23 01:23:23.123123 C:/a/b/c/d.go:23: hello world": map[string]string{
137 "date": "2009/01/23",
138 "time": "01:23:23.123123",
139 "file": "C:/a/b/c/d.go:23",
140 "msg": "hello world",
141 },
142 "01:23:23.123123 C:/a/b/c/d.go:23: hello world": map[string]string{
143 "date": "",
144 "time": "01:23:23.123123",
145 "file": "C:/a/b/c/d.go:23",
146 "msg": "hello world",
147 },
148 "2009/01/23 01:23:23 C:/a/b/c/d.go:23: hello world": map[string]string{
149 "date": "2009/01/23",
150 "time": "01:23:23",
151 "file": "C:/a/b/c/d.go:23",
152 "msg": "hello world",
153 },
154 "2009/01/23 C:/a/b/c/d.go:23: hello world": map[string]string{
155 "date": "2009/01/23",
156 "time": "",
157 "file": "C:/a/b/c/d.go:23",
158 "msg": "hello world",
159 },
160 "C:/a/b/c/d.go:23: hello world": map[string]string{
161 "date": "",
162 "time": "",
163 "file": "C:/a/b/c/d.go:23",
164 "msg": "hello world",
165 },
136166 } {
137167 haveMap := subexps([]byte(input))
138168 for key, want := range wantMap {
141171 }
142172 }
143173 }
144 }
174 }