diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-07-24 01:08:23 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-07-24 01:08:23 (GMT) |
commit | b94feddead6ebb906b17a797477f2d0ff989832e (patch) | |
tree | 7da558d83bbc64b3f27a4b8b4caefc4aff2d0bd8 /src/rhimportd/ctrlWebSimple.go | |
parent | 38cde493d2a9a1961e057fe0e175b437b3916148 (diff) |
client/session specific log prefixes
Diffstat (limited to 'src/rhimportd/ctrlWebSimple.go')
-rw-r--r-- | src/rhimportd/ctrlWebSimple.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/rhimportd/ctrlWebSimple.go b/src/rhimportd/ctrlWebSimple.go index f190f63..8cc2ed0 100644 --- a/src/rhimportd/ctrlWebSimple.go +++ b/src/rhimportd/ctrlWebSimple.go @@ -92,7 +92,6 @@ func webSimpleResponse(w http.ResponseWriter, result *rhimport.Result) { } func webSimpleParseRequest(conf *rhimport.Config, db *rddb.DBChan, trusted bool, r *http.Request) (ctx *rhimport.Context, err error) { - decoder := json.NewDecoder(r.Body) reqdata := newWebSimpleRequestData(conf) if jsonerr := decoder.Decode(reqdata); jsonerr != nil { @@ -100,7 +99,8 @@ func webSimpleParseRequest(conf *rhimport.Config, db *rddb.DBChan, trusted bool, return } - ctx = rhimport.NewContext(conf, db, rhl, rhdl) + logname := "simple-" + r.RemoteAddr + ctx = rhimport.NewContext(conf, db, getStdLog(logname+"-std"), getDbgLog(logname+"-dbg")) if trusted { ctx.UserName = r.Header.Get("X-Forwarded-User") } else { @@ -123,7 +123,7 @@ func webSimpleParseRequest(conf *rhimport.Config, db *rddb.DBChan, trusted bool, } func webSimpleHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport.SessionStoreChan, trusted bool, w http.ResponseWriter, r *http.Request) { - rhdl.Printf("WebSimpleHandler: request for '%s'", html.EscapeString(r.URL.Path)) + rhdl.Printf("WebSimpleHandler: %s requests '%s'", r.RemoteAddr, html.EscapeString(r.URL.Path)) var ctx *rhimport.Context var err error @@ -160,11 +160,6 @@ func webSimpleHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport webSimpleErrorResponse(w, http.StatusInternalServerError, err.Error()) return } - if res.ResponseCode == http.StatusOK { - rhl.Println("ImportFile succesfully imported", ctx.SourceFile) - } else { - rhl.Println("ImportFile import of", ctx.SourceFile, "was unsuccesful") - } webSimpleResponse(w, res) return |