Skip to content

Commit 2facbb6

Browse files
committed
fix non constant strings
1 parent 49353b6 commit 2facbb6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

internal/global/logging.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func Infof(msg string, keysAndValues ...any) {
4343
// Info logs informational messages about the general state of the profiler.
4444
// This is a wrapper around Infof for convenience.
4545
func Info(msg string) {
46-
Infof(msg)
46+
GetLogger().Info(msg)
4747
}
4848

4949
// Errorf logs error messages about exceptional states of the profiler.
@@ -56,7 +56,7 @@ func Errorf(msg string, keysAndValues ...any) {
5656
// Error logs error messages about exceptional states of the profiler.
5757
// This is a wrapper around Errorf for convenience.
5858
func Error(msg error) {
59-
Errorf(msg.Error())
59+
GetLogger().Error(msg.Error())
6060
}
6161

6262
// Debugf logs detailed debugging information about internal profiler behavior.
@@ -69,7 +69,7 @@ func Debugf(msg string, keysAndValues ...any) {
6969
// Debug logs detailed debugging information about internal profiler behavior.
7070
// This is a wrapper around Debugf for convenience.
7171
func Debug(msg string) {
72-
Debugf(msg)
72+
GetLogger().Debug(msg)
7373
}
7474

7575
// Warnf logs warnings in the profiler — not errors, but likely more important
@@ -82,7 +82,7 @@ func Warnf(msg string, keysAndValues ...any) {
8282
// Warn logs warnings in the profiler — not errors, but likely more important
8383
// than informational messages. This is a wrapper around Warnf for convenience.
8484
func Warn(msg string) {
85-
Warnf(msg)
85+
GetLogger().Warn(msg)
8686
}
8787

8888
// Fatalf logs a fatal error message and exits the program.

interpreter/python/python.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ func findInterpreterRanges(info *interpreter.LoaderInfo, ef *pfelf.File,
833833
})
834834
coldRange, err := findColdRange(ef, code, interp)
835835
if err != nil {
836-
log.Errorf(fmt.Sprintf("%w: failed to recover python ranges %s", err, info.FileName()))
836+
log.Errorf("failed to recover python ranges %s: %s", info.FileName(), err.Error())
837837
}
838838
if coldRange != (util.Range{}) {
839839
interpRanges = append(interpRanges, coldRange)

tracer/tracer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,12 @@ func loadProgram(ebpfProgs map[string]*cebpf.Program, tailcallMap *cebpf.Map,
681681
// so we print each line individually.
682682
if ve, ok := err.(*cebpf.VerifierError); ok {
683683
for _, line := range ve.Log {
684-
log.Error(fmt.Errorf(line))
684+
log.Error(fmt.Errorf("%s", line))
685685
}
686686
} else {
687687
scanner := bufio.NewScanner(strings.NewReader(err.Error()))
688688
for scanner.Scan() {
689-
log.Error(fmt.Errorf(scanner.Text()))
689+
log.Error(fmt.Errorf("%s", scanner.Text()))
690690
}
691691
}
692692
return fmt.Errorf("failed to load %s", progSpec.Name)

0 commit comments

Comments
 (0)