concept dlv in category hyperledger

This is an excerpt from Manning's book Programming Hyperledger Fabric: Creating Permissioned Blockchains.
Good luck trying to debug this. You might have the urge to ask on Stack Overflow or Fabric mailing list but chances are no one will be able to help you out with an error as cryptic as above. Unfortunately errors like above are common in Fabric. The first thing to do in situations such as these is to re-run with
FABRIC_LOGGING_SPEC=debugwhich will print out more verbose logs. Many times the verbose logs contain helpful clues to solve the problem. Sometimes we have to go one step further and need to get inside the Fabric codebase - put it under a knife so to speak. The Fabric codebase can be debugged using Delve - a debugger for the Go programming language. We will first show how to use the command line debuggerdlvand later on we’ll show how to integrate it with VS Code IDE for readers who would like to be able to debug from VS Code.First, its a good idea to check the
dlvversion:$ dlv version Delve Debugger Version: 1.3.2 Build: $Id: 569ccbd514fc47c8b4c521b142556867ec5e6917 $Next, to debug the orderer using
dlv, run following command. I have skipped the environment variables in below to save space and avoid repetition but you’ll need to set them appropriately (refer Listing 4.6):Listing 5.2. Command to debug orderer
$ dlv debug github.com/hyperledger/fabric/cmd/orderer --api-version=2 --log=true --Above assumes the Fabric codebase is available under
$GOPATH/src/github.com/hyperledger/fabricdirectory. Change the path to match the location on your system. When above command is run,dlvwill compile and begin debugging the main package in the given directory. Conventionally this package is found in a file calledmain.go. For example, in above case, if we open themain.gofile undergithub.com/hyperledger/fabric/cmd/ordererwe can see: