Move logger lib to web-core repo
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user