Skip to content

Commit

Permalink
feat(comm): support trace level inside the tracer
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Dec 3, 2022
1 parent f94fa82 commit 42c2c5c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions client/test_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ func (self *TestTracer) Info(msg string) {
func (self *TestTracer) Infof(msg string, args ...any) {
log.Printf(msg, args...)
}

func (self *TestTracer) Trace(msg string) {
log.Println(msg)
}

func (self *TestTracer) Tracef(msg string, args ...any) {
log.Printf(msg, args...)
}
4 changes: 4 additions & 0 deletions comm/tracer/dummy_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ func (self *DummyTracer) Logf(level TracerLevel, msg string, args ...any) {}
func (self *DummyTracer) Info(msg string) {}

func (self *DummyTracer) Infof(msg string, args ...any) {}

func (self *DummyTracer) Trace(msg string) {}

func (self *DummyTracer) Tracef(msg string, args ...any) {}
6 changes: 5 additions & 1 deletion comm/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ type Tracer interface {
/// Info log message at info level with fmt method
Infof(msg string, args ...any)

// FIXME: support other trace method
/// Trace log message at trace level
Trace(msg string)

/// Log message at trace level with fmt method
Tracef(msg string, args ...any)
}

0 comments on commit 42c2c5c

Please sign in to comment.