improve debug logging, fix stringer interface, debuglog events sent, fix debuglogging affecting the actual values.

This commit is contained in:
fiatjaf
2023-04-11 11:02:35 -03:00
parent 7f64f2f65e
commit 32768b1a5b
5 changed files with 32 additions and 18 deletions
+3 -2
View File
@@ -4,8 +4,9 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/valyala/fastjson"
"time"
"github.com/valyala/fastjson"
)
func (evt *Event) UnmarshalJSON(payload []byte) error {
@@ -17,7 +18,7 @@ func (evt *Event) UnmarshalJSON(payload []byte) error {
obj, err := parsed.Object()
if err != nil {
return fmt.Errorf("event is not an object")
return fmt.Errorf("event is not an object: %w", err)
}
// prepare this to receive any extra property that may serialized along with the event