Make regex more flexible
@@ -24,7 +24,7 @@ func NewJSONColorFormatter(parent string, pretty bool) logrus.Formatter {
}
}
-var keyRegex = regexp.MustCompile(`"([A-Za-z0-9-_]+)":`)
+var keyRegex = regexp.MustCompile(`"(?:(?:[^"]|\\")*)"\s*:`)
func (jcf *JSONColorFormatter) Format(entry *logrus.Entry) ([]byte, error) {
b, err := jcf.inner.Format(entry)
