Logging in subscribe and publish command
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/emersion/go-smtp"
|
||||
"net/http"
|
||||
@@ -59,14 +58,3 @@ func logHTTPPrefix(v *visitor, r *http.Request) string {
|
||||
func logSMTPPrefix(state *smtp.ConnectionState) string {
|
||||
return fmt.Sprintf("%s/%s SMTP", state.Hostname, state.RemoteAddr.String())
|
||||
}
|
||||
|
||||
func maybeMarshalJSON(v interface{}) string {
|
||||
messageJSON, err := json.MarshalIndent(v, "", " ")
|
||||
if err != nil {
|
||||
return "<cannot serialize>"
|
||||
}
|
||||
if len(messageJSON) > 5000 {
|
||||
return string(messageJSON)[:5000]
|
||||
}
|
||||
return string(messageJSON)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user