Added | separator to the start of all log.Printf() to separate date and action.
This commit is contained in:
parent
3327b30d12
commit
fccb81d3a5
@ -135,7 +135,7 @@ func (h *UploadHandlers) Upload(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
typ, _ := utils.NetworkType(r.Host)
|
||||
|
||||
h.logFile.Printf("up | %s | %s | %s | SHA256 %s | %s | %d | %s", r.Header.Get("X-Real-IP"), typ,
|
||||
h.logFile.Printf("| up | %s | %s | %s | SHA256 %s | %s | %d | %s", r.Header.Get("X-Real-IP"), typ,
|
||||
fHandler.Filename, fHash, fSaltedHash, fHandler.Size, r.UserAgent())
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
@ -187,7 +187,7 @@ func (h *UploadHandlers) Download(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
netTyp, _ := utils.NetworkType(r.Host)
|
||||
|
||||
h.logFile.Printf("dw | %s | %s | %s | %s | %s", r.Header.Get("X-Real-IP"), netTyp, name, saltedHash, r.UserAgent())
|
||||
h.logFile.Printf("| dw | %s | %s | %s | %s | %s", r.Header.Get("X-Real-IP"), netTyp, name, saltedHash, r.UserAgent())
|
||||
|
||||
http.ServeContent(w, r, path, stat.ModTime(), fd)
|
||||
}
|
||||
@ -218,7 +218,7 @@ func (h *UploadHandlers) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
netTyp, _ := utils.NetworkType(r.Host)
|
||||
|
||||
h.logFile.Printf("dt | %s | %s | %s | %s", r.Header.Get("X-Real-IP"), netTyp, saltedHash, r.UserAgent())
|
||||
h.logFile.Printf("| dt | %s | %s | %s | %s", r.Header.Get("X-Real-IP"), netTyp, saltedHash, r.UserAgent())
|
||||
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
if strings.Contains(r.UserAgent(), "curl") || strings.Contains(r.UserAgent(), "Wget") {
|
||||
|
Loading…
Reference in New Issue
Block a user