mirror of
https://github.com/amir20/dozzle.git
synced 2026-08-07 11:04:45 +00:00
fix(level-guesser): recognize "Information" as info level (#4833)
This commit is contained in:
@@ -15,7 +15,7 @@ var SupportedLogLevels map[string]struct{}
|
||||
var logLevels = [][]string{
|
||||
{"error", "err"},
|
||||
{"warn", "warning", "wrn"},
|
||||
{"info", "inf"},
|
||||
{"info", "inf", "information"},
|
||||
{"debug", "dbg"},
|
||||
{"trace", "verbose", "ver", "vbs"},
|
||||
{"fatal", "sev", "severe", "crit", "critical"},
|
||||
|
||||
@@ -115,6 +115,20 @@ func TestGuessLogLevel(t *testing.T) {
|
||||
{"WARN: connection error: retrying", "warn"},
|
||||
// Symmetric: an ERROR prefix still wins over a later info word.
|
||||
{"ERROR: handler failed, info: will retry", "error"},
|
||||
// .NET / Serilog / Microsoft.Extensions.Logging spell out "Information".
|
||||
{"Information: service started", "info"},
|
||||
{"[Information] service started", "info"},
|
||||
{"2024-12-30T17:43:16Z Information starting up", "info"},
|
||||
{orderedmap.New[string, string](
|
||||
orderedmap.WithInitialData(
|
||||
orderedmap.Pair[string, string]{Key: "level", Value: "Information"},
|
||||
),
|
||||
), "info"},
|
||||
{orderedmap.New[string, any](
|
||||
orderedmap.WithInitialData(
|
||||
orderedmap.Pair[string, any]{Key: "@l", Value: "Information"},
|
||||
),
|
||||
), "info"},
|
||||
// Equal confidence between two different levels -> unknown (don't guess).
|
||||
{"saw info: here and error: there", "unknown"},
|
||||
{"[INFO] [DEBUG] both bracketed", "unknown"},
|
||||
|
||||
Reference in New Issue
Block a user