git » gofer » commit b13b9ea

trace: Remove obsolete Trace.Debugf function

author Alberto Bertogli
2022-09-25 10:11:04 UTC
committer Alberto Bertogli
2022-10-07 10:59:43 UTC
parent 4e88b65f7506d1d28c8285cef85d22af30550006

trace: Remove obsolete Trace.Debugf function

This patch removes the obsolete Trace.Debugf function, which was replaced
by Trace.Printf (they're now identical), and has only one leftover caller.

server/http.go +1 -1
trace/trace.go +0 -8

diff --git a/server/http.go b/server/http.go
index a4a260f..bed2160 100644
--- a/server/http.go
+++ b/server/http.go
@@ -249,7 +249,7 @@ func makeCGI(path string, cmd []string) http.Handler {
 	path = stripDomain(path)
 	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		tr, _ := trace.FromContext(r.Context())
-		tr.Debugf("exec %q", cmd)
+		tr.Printf("exec %q", cmd)
 		h := cgi.Handler{
 			Path:   cmd[0],
 			Args:   cmd[1:],
diff --git a/trace/trace.go b/trace/trace.go
index f4c7beb..34b5418 100644
--- a/trace/trace.go
+++ b/trace/trace.go
@@ -44,14 +44,6 @@ func (t *Trace) SetMaxEvents(n int) {
 func (t *Trace) Printf(format string, a ...interface{}) {
 	t.t.Printf(format, a...)
 
-	log.Log(log.Debug, 1, "%#p %s %s: %s", t, t.family, t.title,
-		fmt.Sprintf(format, a...))
-}
-
-// Debugf adds this message to the trace's log, with a debugging level.
-func (t *Trace) Debugf(format string, a ...interface{}) {
-	t.t.Printf(format, a...)
-
 	log.Log(log.Debug, 1, "%#p %s %s: %s",
 		t, t.family, t.title, fmt.Sprintf(format, a...))
 }