Skip to content

Commit

Permalink
[log] Add variable 'LogLevels' with all supported log level names
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Dec 5, 2024
1 parent cd5e2ea commit 1e0b491
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`_)
Expand Down
14 changes: 14 additions & 0 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -145,6 +158,7 @@ var (
var logLevelsNames = map[string]uint8{
"debug": 0,
"info": 1,
"": 1, // default
"warn": 2,
"warning": 2,
"error": 3,
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ package ek
// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION is current ek package version
const VERSION = "13.14.1"
const VERSION = "13.14.2"

0 comments on commit 1e0b491

Please sign in to comment.