on main help sign in
chore: fix lint
979384aKujtim Hoxha
internal/logging/logger.go+3−1
@@ -4,6 +4,7 @@ import (
4 "fmt"
4 "fmt"
5 "log/slog"
5 "log/slog"
6 "os"
6 "os"
7+
7 // "path/filepath"
8 // "path/filepath"
8 "encoding/json"
9 "encoding/json"
9 "runtime"
10 "runtime"
@@ -22,6 +23,7 @@ func getCaller() string {
22 }
23 }
23 return caller
24 return caller
24}
25}
26+
25func Info(msg string, args ...any) {
27func Info(msg string, args ...any) {
26 source := getCaller()
28 source := getCaller()
27 slog.Info(msg, append([]any{"source", source}, args...)...)
29 slog.Info(msg, append([]any{"source", source}, args...)...)
@@ -122,7 +124,7 @@ func AppendToSessionLogFile(sessionId string, filename string, content string) s
122
124
123 filePath := fmt.Sprintf("%s/%s", sessionPath, filename)
125 filePath := fmt.Sprintf("%s/%s", sessionPath, filename)
124
126
125− f, err := os.OpenFile(filePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
127+ f, err := os.OpenFile(filePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
126 if err != nil {
128 if err != nil {
127 Error("Failed to open session log file", "filepath", filePath, "error", err)
129 Error("Failed to open session log file", "filepath", filePath, "error", err)
128 return ""
130 return ""