shithub: hugo

Download patch

ref: d3a98325c31d7f02f0762e589a4986e55b2a0da2
parent: b2a676f5f09a3eea360887b099b9d5fc25a88492
author: Bjørn Erik Pedersen <[email protected]>
date: Thu Nov 1 05:33:32 EDT 2018

common/loggers: Improve log color regexp

To avoid coloring WARNING inside log errors.

--- a/common/loggers/loggers.go
+++ b/common/loggers/loggers.go
@@ -82,7 +82,7 @@
 
 var (
 	ansiColorRe = regexp.MustCompile("(?s)\\033\\[\\d*(;\\d*)*m")
-	errorRe     = regexp.MustCompile("(ERROR|FATAL|WARN)")
+	errorRe     = regexp.MustCompile("^(ERROR|FATAL|WARN)")
 )
 
 type ansiCleaner struct {