change logging

This commit is contained in:
filifa 2024-07-11 22:15:01 -05:00
parent 1e5a532bfd
commit a17786e98c
1 changed files with 4 additions and 1 deletions

View File

@ -54,6 +54,7 @@ func setValue(obj any, key string, value any) error {
case map[string]any: case map[string]any:
log.Println("Formerly", v[key]) log.Println("Formerly", v[key])
v[key] = value v[key] = value
log.Println("Now", v[key])
case []any: case []any:
idx, err := strconv.Atoi(key) idx, err := strconv.Atoi(key)
if err != nil { if err != nil {
@ -61,7 +62,9 @@ func setValue(obj any, key string, value any) error {
} }
v = expand(v, idx) v = expand(v, idx)
log.Println("Formerly", v[idx])
v[idx] = value v[idx] = value
log.Println("Now", v[idx])
default: default:
err = errors.New("couldn't determine type") err = errors.New("couldn't determine type")
} }
@ -101,7 +104,7 @@ func patch(obj any, path string, value any) error {
func (f *FeedResponse) Patch(instr *instruction) { func (f *FeedResponse) Patch(instr *instruction) {
// TODO: need to handle each type of instruction separately: add, // TODO: need to handle each type of instruction separately: add,
// replace, remove, copy, move // replace, remove, copy, move
log.Println("updating", instr.Path, "to", instr.Value) log.Println("updating", instr.Path)
err := patch(f, instr.Path, instr.Value) err := patch(f, instr.Path, instr.Value)
if err != nil { if err != nil {
log.Println(err) log.Println(err)