(new): add threshold-based log level filtering and docs
Golang lint / lint (push) Successful in 1m36s

- add threshold-aware LogLevel constructors
- add Logger.SetThresholdMode and SameThreshold
- preserve legacy SameLevel behavior for compatibility
- extend tests for threshold mode and compatibility
- update README and release notes for v2.2.0
This commit is contained in:
2026-04-28 09:45:40 +03:00
parent b7fa3f7606
commit e6d15b530f
8 changed files with 216 additions and 35 deletions
+3 -1
View File
@@ -84,7 +84,9 @@ func (l *Logger) Debugln(m ...any) {
}
func (l *Logger) print(level LogLevel, newline bool, m ...any) {
if l.level.n < level.n {
if l.threshold && l.level.th < level.th {
return
} else if l.level.n < level.n {
return
}
if len(l.writers) == 0 {