mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-26 15:16:27 +01:00
feat: adds warning as possible level
This commit is contained in:
@@ -55,7 +55,8 @@ div {
|
||||
background-color: var(--red-color);
|
||||
}
|
||||
|
||||
&.warn {
|
||||
&.warn,
|
||||
&.warning {
|
||||
background-color: var(--orange-color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ var ANSI_COLOR_REGEX = regexp.MustCompile(`\x1b\[[0-9;]*m`)
|
||||
func guessLogLevel(logEvent *LogEvent) string {
|
||||
switch value := logEvent.Message.(type) {
|
||||
case string:
|
||||
levels := []string{"error", "warn", "info", "debug", "trace", "fatal"}
|
||||
levels := []string{"error", "warn", "warning", "info", "debug", "trace", "fatal"}
|
||||
stripped := ANSI_COLOR_REGEX.ReplaceAllString(value, "") // remove ansi color codes
|
||||
for _, level := range levels {
|
||||
if match, _ := regexp.MatchString("(?i)^"+level+"[^a-z]", stripped); match {
|
||||
|
||||
Reference in New Issue
Block a user