summaryrefslogtreecommitdiff
path: root/internal/logging
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-08 12:02:40 +0300
committerPaul Buetow <paul@buetow.org>2025-09-08 12:02:40 +0300
commit75cf6abd55bfb60324fc47cf91eac08dbb8b87b4 (patch)
tree6ef90d8014fe4d9a757d3f7e95bf736b70e4c685 /internal/logging
parent0dcf347c3fbc6e4ffb7e46294f5dd92dbbcd98ef (diff)
docs: move tmux documentation to its own file
Diffstat (limited to 'internal/logging')
-rw-r--r--internal/logging/logging_test.go33
1 files changed, 16 insertions, 17 deletions
diff --git a/internal/logging/logging_test.go b/internal/logging/logging_test.go
index 716781e..31603f0 100644
--- a/internal/logging/logging_test.go
+++ b/internal/logging/logging_test.go
@@ -1,24 +1,23 @@
package logging
import (
- "bytes"
- "log"
- "testing"
+ "bytes"
+ "log"
+ "testing"
)
func TestPreviewAndLogfAndChatLogger(t *testing.T) {
- var buf bytes.Buffer
- Bind(log.New(&buf, "", 0))
- SetLogPreviewLimit(3)
- if got := PreviewForLog("abcdef"); got != "abc…" {
- t.Fatalf("preview wrong: %q", got)
- }
- Logf("unit ", "hello %s", "x")
- cl := NewChatLogger("p")
- cl.LogStart(true, "m", 0.5, 100, []string{"stop"}, []struct{ Role, Content string }{{"user", "hello"}})
- out := buf.String()
- if out == "" || !bytes.Contains([]byte(out), []byte("start")) {
- t.Fatalf("expected logged content, got %q", out)
- }
+ var buf bytes.Buffer
+ Bind(log.New(&buf, "", 0))
+ SetLogPreviewLimit(3)
+ if got := PreviewForLog("abcdef"); got != "abc…" {
+ t.Fatalf("preview wrong: %q", got)
+ }
+ Logf("unit ", "hello %s", "x")
+ cl := NewChatLogger("p")
+ cl.LogStart(true, "m", 0.5, 100, []string{"stop"}, []struct{ Role, Content string }{{"user", "hello"}})
+ out := buf.String()
+ if out == "" || !bytes.Contains([]byte(out), []byte("start")) {
+ t.Fatalf("expected logged content, got %q", out)
+ }
}
-