forked from TrueCloudLab/restic
debug: init debug logger before init() methods run
This commit is contained in:
parent
ca77655971
commit
9d29a61861
1 changed files with 7 additions and 1 deletions
|
@ -20,12 +20,18 @@ var opts struct {
|
||||||
m sync.Mutex
|
m sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
// make sure that all the initialization happens before the init() functions
|
||||||
|
// are called, cf https://golang.org/ref/spec#Package_initialization
|
||||||
|
var _ = initDebug()
|
||||||
|
|
||||||
|
func initDebug() bool {
|
||||||
initDebugLogger()
|
initDebugLogger()
|
||||||
initDebugTags()
|
initDebugTags()
|
||||||
initDebugBreaks()
|
initDebugBreaks()
|
||||||
|
|
||||||
fmt.Fprintf(os.Stderr, "debug enabled\n")
|
fmt.Fprintf(os.Stderr, "debug enabled\n")
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func initDebugLogger() {
|
func initDebugLogger() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue