Debugging

Techniques for debugging

Debug Logging

import (
  "github.com/freeconf/yang/fc"
)

...
   // turn on debug logging
   fc.DebugLog(true)

Logging node activity

Use cases:

  • See all operations performed on a node when you’re not sure you are getting the right data in or out.

Usage

  // wrap all node activity to the node app recursively
  n := nodeutil.Dump(manageApp(app), os.Stdout)

Example Edit

BeginEdit, new=false, src=car
->speed=int32(10)
EndEdit, new=false, src=car

Example Read

<-speed=int32(10)
<-miles=decimal64(310.000000)

tips:

  • Take a look at the source and create your own dumper that is maybe better.
  • You can do this at root node or any part of the tree you want to inspect