From 833bb66706dd991ecd3973da360c472d818e970a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 16 Aug 2025 16:26:12 +0300 Subject: 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 --- internal/lsp/context.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'internal/lsp/context.go') diff --git a/internal/lsp/context.go b/internal/lsp/context.go index 8b7ed67..8f345df 100644 --- a/internal/lsp/context.go +++ b/internal/lsp/context.go @@ -2,6 +2,7 @@ package lsp import ( "strings" + "hexai/internal/logging" ) // buildAdditionalContext builds extra context messages based on the configured mode. @@ -33,9 +34,7 @@ func (s *Server) buildAdditionalContext(newFunc bool, uri string, pos Position) func (s *Server) windowContext(uri string, pos Position) string { d := s.getDocument(uri) if d == nil || len(d.lines) == 0 { - if s.logger != nil { - s.logger.Printf("context: window requested but document not open; skipping uri=%s", uri) - } + logging.Logf("lsp ", "context: window requested but document not open; skipping uri=%s", uri) return "" } n := len(d.lines) @@ -55,9 +54,7 @@ func (s *Server) windowContext(uri string, pos Position) string { func (s *Server) fullFileContext(uri string) string { d := s.getDocument(uri) if d == nil { - if s.logger != nil { - s.logger.Printf("context: full-file requested but document not open; skipping uri=%s", uri) - } + logging.Logf("lsp ", "context: full-file requested but document not open; skipping uri=%s", uri) return "" } return truncateToApproxTokens(d.text, s.maxContextTokens) -- cgit v1.2.3