Ocpp: reduce trace logs
This commit is contained in:
parent
fe2978d724
commit
ba75820a42
1 changed files with 23 additions and 8 deletions
|
|
@ -2,18 +2,33 @@ package ocpp
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (cs *CS) print(s string) {
|
||||
// var ok bool
|
||||
// if s, ok = strings.CutPrefix(s, "sent JSON message to"); ok {
|
||||
// s = "send" + s
|
||||
// } else if s, ok = strings.CutPrefix(s, "received JSON message from"); ok {
|
||||
// s = "recv" + s
|
||||
// }
|
||||
// if ok {
|
||||
cs.log.TRACE.Println(s)
|
||||
// for _, p := range []string{
|
||||
// "completed request",
|
||||
// "dispatched request",
|
||||
// "enqueued CALL",
|
||||
// "handling incoming",
|
||||
// "sent CALL",
|
||||
// "started timeout",
|
||||
// "timeout canceled",
|
||||
// } {
|
||||
// if strings.HasPrefix(s, p) {
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
|
||||
var ok bool
|
||||
if s, ok = strings.CutPrefix(s, "sent JSON message to"); ok {
|
||||
s = "send" + s
|
||||
} else if s, ok = strings.CutPrefix(s, "received JSON message from"); ok {
|
||||
s = "recv" + s
|
||||
}
|
||||
if ok {
|
||||
cs.log.TRACE.Println(s)
|
||||
}
|
||||
}
|
||||
|
||||
func (cs *CS) Debug(args ...interface{}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue