mirror of
https://github.com/Jguer/yay
synced 2024-10-04 15:19:08 +00:00
fix(logger): respect --debug for setting debug logger (#1955)
respect --debug parse
This commit is contained in:
parent
7e7764a797
commit
f11f9058c2
|
@ -5,6 +5,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func (c *Configuration) ParseCommandLine(a *parser.Arguments) error {
|
||||
|
@ -56,6 +57,10 @@ func (c *Configuration) handleOption(option, value string) bool {
|
|||
c.CleanAfter = true
|
||||
case "noafterclean", "nocleanafter":
|
||||
c.CleanAfter = false
|
||||
case "debug":
|
||||
c.Debug = true
|
||||
c.Runtime.Logger.Debug = true
|
||||
text.GlobalLogger.Debug = true
|
||||
case "devel":
|
||||
c.Devel = true
|
||||
case "nodevel":
|
||||
|
|
|
@ -314,7 +314,7 @@ func NewConfig(version string) (*Configuration, error) {
|
|||
metadata.WithCacheFilePath(filepath.Join(newConfig.BuildDir, "aur.json")),
|
||||
metadata.WithRequestEditorFn(userAgentFn),
|
||||
metadata.WithBaseURL(newConfig.AURURL),
|
||||
metadata.WithDebugLogger(newConfig.Runtime.Logger.Child("aur").Debugln),
|
||||
metadata.WithDebugLogger(newConfig.Runtime.Logger.Debugln),
|
||||
)
|
||||
if errAURCache != nil {
|
||||
return nil, fmt.Errorf(gotext.Get("failed to retrieve aur Cache")+": %w", errAURCache)
|
||||
|
@ -324,7 +324,7 @@ func NewConfig(version string) (*Configuration, error) {
|
|||
newConfig.Runtime.AURClient, errAUR = rpc.NewClient(
|
||||
rpc.WithHTTPClient(newConfig.Runtime.HTTPClient),
|
||||
rpc.WithRequestEditorFn(userAgentFn),
|
||||
rpc.WithLogFn(newConfig.Runtime.Logger.Child("rpc").Debugln))
|
||||
rpc.WithLogFn(newConfig.Runtime.Logger.Debugln))
|
||||
if errAUR != nil {
|
||||
return nil, errAUR
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue