mirror of
https://github.com/lukaszraczylo/kportal.git
synced 2026-07-11 07:22:15 +00:00
bugfixes nov2025 (#3)
* Fix enter misbehaving. * Cleanup after previous tui implementation. * Fix race condition and improve logging * Add filtering of the namespaces by text input in the wizard UI
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -28,6 +29,7 @@ type Logger struct {
|
||||
level Level
|
||||
format Format
|
||||
output io.Writer
|
||||
mu sync.Mutex // Protects concurrent writes to output
|
||||
}
|
||||
|
||||
type logEntry struct {
|
||||
@@ -55,6 +57,9 @@ func (l *Logger) log(level Level, msg string, fields map[string]interface{}) {
|
||||
|
||||
levelStr := levelToString(level)
|
||||
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
|
||||
if l.format == FormatJSON {
|
||||
entry := logEntry{
|
||||
Time: time.Now().Format(time.RFC3339),
|
||||
|
||||
Reference in New Issue
Block a user