From 1e0b49129b02efe9c16b747e2451d84110b6062b Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 5 Dec 2024 14:57:54 +0300 Subject: [PATCH] [log] Add variable 'LogLevels' with all supported log level names --- CHANGELOG.md | 4 ++++ log/log.go | 14 ++++++++++++++ version.go | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9310115c..d5778ebe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Changelog +### [13.14.2](https://kaos.sh/ek/13.14.2) + +- `[log]` Added variable `LogLevels` with all supported log level names + ### [13.14.1](https://kaos.sh/ek/13.14.1) - `[usage]` Fixed bug with rendering examples (_introduced in `13.14.0`_) diff --git a/log/log.go b/log/log.go index a381233b..bcf614ea 100644 --- a/log/log.go +++ b/log/log.go @@ -126,6 +126,19 @@ var Colors = map[uint8]string{ CRIT: "{#196}{*}", } +// LogLevels is a slice with supported log level names +var LogLevels = []string{ + "", + "debug", + "info", + "warn", + "warning", + "error", + "crit", + "critical", + "fatal", +} + // ////////////////////////////////////////////////////////////////////////////////// // // Errors @@ -145,6 +158,7 @@ var ( var logLevelsNames = map[string]uint8{ "debug": 0, "info": 1, + "": 1, // default "warn": 2, "warning": 2, "error": 3, diff --git a/version.go b/version.go index f0482266..085c7f47 100644 --- a/version.go +++ b/version.go @@ -8,4 +8,4 @@ package ek // ////////////////////////////////////////////////////////////////////////////////// // // VERSION is current ek package version -const VERSION = "13.14.1" +const VERSION = "13.14.2"