diff options
| author | Jeff Carr <[email protected]> | 2025-09-08 12:42:24 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-08 12:42:24 -0500 |
| commit | f23109dce8f5657bd10e9e4dcbfe58b8beae20e1 (patch) | |
| tree | 4df710249d9b12a6ec1f9f6723c6fe0a028cb9a6 /http.go | |
| parent | e1411dd1e93914ba240f1813e6922ae87ef98653 (diff) | |
fix the build
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -49,14 +49,16 @@ func whoSent(r *http.Request) string { } func logReqPB(pb *httppb.HttpRequest) { - log.Info("LOG: httppb.HttpRequest Errors START:") - log.Info(strings.Join(pb.Errors, "\n")) - log.Info("LOG: httppb.HttpRequest Errors END") + log.Info("LOG: httppb.HttpRequest START:") + for i, line := range strings.Join(pb.Log, "\n") { + log.Infof("\t%d %s\n", i, line) + } + log.Info("LOG: httppb.HttpRequest END") } func okHandler(w http.ResponseWriter, r *http.Request) { reqPB, err := httppb.ReqToPB(r) - reqPB.Errors = append(reqPB.Errors, fmt.Sprintf("START: Got %d bytes from the client", len(reqPB.Body))) + reqPB.Log = append(reqPB.Log, fmt.Sprintf("START: Got %d bytes from the client", len(reqPB.ClientData))) if err != nil { log.Info("something crazy err", err) } @@ -85,7 +87,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(route, "/repos/") { pb, err := makeReposPB(reqPB) if err != nil { - reqPB.Errors = append(reqPB.Errors, log.Sprintf("%v", err)) + reqPB.Log = append(reqPB.Log, log.Sprintf("%v", err)) } result := gitpb.NewRepos() switch route { @@ -110,7 +112,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(route, "/patches/") { pb, err := makePatchesPB(reqPB) if err != nil { - reqPB.Errors = append(reqPB.Errors, log.Sprintf("%v", err)) + reqPB.Log = append(reqPB.Log, log.Sprintf("%v", err)) } result := forgepb.NewPatches() switch route { @@ -141,7 +143,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(route, "/patchsets/") { pb, err := makePatchsetsPB(reqPB) if err != nil { - reqPB.Errors = append(reqPB.Errors, log.Sprintf("%v", err)) + reqPB.Log = append(reqPB.Log, log.Sprintf("%v", err)) } result := forgepb.NewPatchsets() switch route { @@ -153,7 +155,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if err := result.SendReply(w, reqPB); err != nil { log.Info("Oh well, Send to client failed. err =", err) } - log.Info("Send to client seems to have worked. errors:", reqPB.Errors) + log.Info("Send to client seems to have worked. log:", reqPB.Log) me.forge.SavePatchsets() // todo: logReq(reqPB) logReqPB(reqPB) |
