mirror of
https://github.com/garraflavatra/go-fmp.git
synced 2025-06-27 20:15:11 +00:00
Debug flag
This commit is contained in:
@ -5,23 +5,31 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
const debugging = false
|
||||
|
||||
func debug(str string, args ...interface{}) {
|
||||
// fmt.Printf(str+"\n", args...)
|
||||
if debugging {
|
||||
fmt.Printf(str+"\n", args...)
|
||||
}
|
||||
}
|
||||
|
||||
func dump(data []byte) {
|
||||
if debugging {
|
||||
for _, b := range data {
|
||||
fmt.Printf("%02x ", b)
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
|
||||
func dumpPath(path []uint64) {
|
||||
if debugging {
|
||||
for _, p := range path {
|
||||
fmt.Printf("%v. ", p)
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
|
||||
func (f *FmpFile) ToDebugFile(fname string) {
|
||||
f_sectors, err := os.Create(fname + ".sectors")
|
||||
|
Reference in New Issue
Block a user