mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-07 21:09:53 +00:00
Add debug level logging option
This update introduces the ability to enable logging from the caller when the log level is set to "debug". This additional logging feature will provide more specificity and context for debugging tasks, aiding in quicker issue resolution.
This commit is contained in:
parent
115d7bad6f
commit
4a234d50e2
11
cmd/root.go
11
cmd/root.go
@ -75,6 +75,11 @@ func run() error {
|
||||
if err := config.Unmarshal(panelConfig); err != nil {
|
||||
return fmt.Errorf("Parse config file %v failed: %s \n", cfgFile, err)
|
||||
}
|
||||
|
||||
if panelConfig.LogConfig.Level == "debug" {
|
||||
log.SetReportCaller(true)
|
||||
}
|
||||
|
||||
p := panel.New(panelConfig)
|
||||
lastTime := time.Now()
|
||||
config.OnConfigChange(func(e fsnotify.Event) {
|
||||
@ -88,10 +93,16 @@ func run() error {
|
||||
if err := config.Unmarshal(panelConfig); err != nil {
|
||||
log.Panicf("Parse config file %v failed: %s \n", cfgFile, err)
|
||||
}
|
||||
|
||||
if panelConfig.LogConfig.Level == "debug" {
|
||||
log.SetReportCaller(true)
|
||||
}
|
||||
|
||||
p.Start()
|
||||
lastTime = time.Now()
|
||||
}
|
||||
})
|
||||
|
||||
p.Start()
|
||||
defer p.Close()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user