/usr/share/gocode/src/github.com/constabulary/gb/internal/debug/debug.go is in golang-github-constabulary-gb-dev 0.4.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | // debug provides a light weight debug facility.
// Usage is via the DEBUG environment variable. Any non empty value will
// enable debug logging. For example
//
// DEBUG=. gb
//
// The period is a hint that the value passed to DEBUG is a regex, which matches
// files, or packages present in the file part of the file/line pair logged as a
// prefix of the log line. (not implemented yet)
//
// Debug output is send to os.Stderr, there is no facility to change this.
package debug
import (
"fmt"
"log"
"os"
)
var debug = os.Getenv("DEBUG")
var logger = log.New(os.Stderr, "", log.Ldate|log.Ltime|log.Lshortfile)
func Debugf(format string, args ...interface{}) {
if len(debug) == 0 {
return
}
logger.Output(2, fmt.Sprintf(format, args...))
}
|