summaryrefslogtreecommitdiff
path: root/internal/llm/logging.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-16 16:26:12 +0300
committerPaul Buetow <paul@buetow.org>2025-08-16 16:26:12 +0300
commit833bb66706dd991ecd3973da360c472d818e970a (patch)
tree62d8465b305883af1002063eb54ef38a08de299d /internal/llm/logging.go
parent148cda5f7ed4513528e3a46164b990708eeb1bc6 (diff)
logging: migrate LSP logs to global singleton (internal/logging); use consistent colors/prefix; refactor LLM provider to use global logger and remove per-client loggers
Diffstat (limited to 'internal/llm/logging.go')
-rw-r--r--internal/llm/logging.go43
1 files changed, 0 insertions, 43 deletions
diff --git a/internal/llm/logging.go b/internal/llm/logging.go
deleted file mode 100644
index a6a6e51..0000000
--- a/internal/llm/logging.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package llm
-
-import (
- "fmt"
- "log"
-)
-
-// ANSI color utilities shared across LLM providers.
-const (
- AnsiBgBlack = "\x1b[40m"
- AnsiGrey = "\x1b[90m"
- AnsiCyan = "\x1b[36m"
- AnsiGreen = "\x1b[32m"
- AnsiRed = "\x1b[31m"
- AnsiReset = "\x1b[0m"
-)
-
-// AnsiBase is the default style: black background + grey foreground.
-const AnsiBase = AnsiBgBlack + AnsiGrey
-
-// LogPrintf wraps a formatted message with a base style and prints with a prefix.
-func LogPrintf(logger *log.Logger, prefix, format string, args ...any) {
- if logger == nil {
- return
- }
- msg := fmt.Sprintf(format, args...)
- logger.Print(AnsiBase + prefix + msg + AnsiReset)
-}
-
-// Logging configuration for previews (shared)
-var logPreviewLimit int // 0 means unlimited
-
-// SetLogPreviewLimit sets the maximum number of characters to log for
-// request/response previews. Set to 0 for unlimited.
-func SetLogPreviewLimit(n int) { logPreviewLimit = n }
-
-func previewForLog(s string) string {
- if logPreviewLimit > 0 {
- return trimPreview(s, logPreviewLimit)
- }
- return s
-}
-