Skip to content

Commit b83116d

Browse files
AnnatarHeclaude
andcommitted
refactor(daemon): improve logging in sync handler and ccusage service
- Remove verbose debug logging from sync handler - Change CCUsage collection failure log level from Warn to Error - Add warning log when neither bunx nor npx are found 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 91317d3 commit b83116d

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

daemon/handlers.sync.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ func handlePubSubSync(ctx context.Context, socketMsgPayload interface{}) error {
3232
return err
3333
}
3434

35-
// Call SendLocalDataToServer
36-
slog.Debug("Sending local data to server",
37-
slog.Any("ctx", ctx),
38-
slog.Any("cfg", cfg),
39-
slog.Time("cursor", time.Unix(0, syncMsg.CursorID)),
40-
slog.Any("data", syncMsg.Data),
41-
slog.Any("meta", syncMsg.Meta),
42-
)
43-
4435
payload := model.PostTrackArgs{
4536
CursorID: time.Unix(0, syncMsg.CursorID).UnixNano(), // Convert nano timestamp to time.Time
4637
Data: syncMsg.Data,

model/ccusage_service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (s *ccUsageService) Start(ctx context.Context) error {
7070
select {
7171
case <-s.ticker.C:
7272
if err := s.CollectCCUsage(ctx); err != nil {
73-
slog.Warn("CCUsage collection failed", "error", err)
73+
slog.Error("CCUsage collection failed", "error", err)
7474
}
7575
case <-s.stopChan:
7676
slog.Info("Stopping CCUsage collection service")
@@ -313,6 +313,7 @@ func (s *ccUsageService) collectData(ctx context.Context, since time.Time) (*CCU
313313
npxPath, npxErr := lookPath("npx")
314314

315315
if bunxErr != nil && npxErr != nil {
316+
slog.Warn("error looking for bunx or npx", "bunxErr", bunxErr, "npxErr", npxErr)
316317
return nil, fmt.Errorf("neither bunx nor npx found in system PATH or common installation locations")
317318
}
318319

0 commit comments

Comments
 (0)