Move logger lib to web-core repo

This commit is contained in:
Matt Baer
2015-06-28 16:54:38 -04:00
commit 1b278fa92b
5 changed files with 79 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
package logger
import (
"regexp"
)
var postReg = regexp.MustCompile("(.*(/|id=))[a-zA-Z0-9]{12,13}(.*)")
var tokenReg = regexp.MustCompile("(.*t=)[a-zA-Z0-9]{32}(.*)")
func ScrubID(uri string) string {
curStr := postReg.ReplaceAllString(uri, "$1[scrubbed]$3")
curStr = tokenReg.ReplaceAllString(curStr, "$1[scrubbed]$2")
return curStr
}