Merge pull request #2558 from canton7/feature/logging-debug
Only print 'Enabled/Disabled debug data for ...' if it was enabled/disabled
This commit is contained in:
commit
2ab07f3aac
|
@ -398,14 +398,14 @@ func (s *apiSvc) postSystemDebug(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
q := r.URL.Query()
|
q := r.URL.Query()
|
||||||
for _, f := range strings.Split(q.Get("enable"), ",") {
|
for _, f := range strings.Split(q.Get("enable"), ",") {
|
||||||
if f == "" {
|
if f == "" || l.ShouldDebug(f) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
l.SetDebug(f, true)
|
l.SetDebug(f, true)
|
||||||
l.Infof("Enabled debug data for %q", f)
|
l.Infof("Enabled debug data for %q", f)
|
||||||
}
|
}
|
||||||
for _, f := range strings.Split(q.Get("disable"), ",") {
|
for _, f := range strings.Split(q.Get("disable"), ",") {
|
||||||
if f == "" {
|
if f == "" || !l.ShouldDebug(f) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
l.SetDebug(f, false)
|
l.SetDebug(f, false)
|
||||||
|
|
Loading…
Reference in New Issue