Merge "Use log module to determine current log level"
This commit is contained in:
commit
70250e356e
pkg
@ -71,7 +71,7 @@ func GenerateBootstrapIso(settings *environment.AirshipCTLSettings) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = generateBootstrapIso(docBundle, builder, cfg, settings.Debug)
|
||||
err = generateBootstrapIso(docBundle, builder, cfg, log.DebugEnabled())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func NewExecutor(cfg ifc.ExecutorConfig) (ifc.Executor, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := NewClient(tgtPath, cfg.AirshipSettings.Debug, options)
|
||||
client, err := NewClient(tgtPath, log.DebugEnabled(), options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
"opendev.org/airship/airshipctl/pkg/config"
|
||||
"opendev.org/airship/airshipctl/pkg/document"
|
||||
"opendev.org/airship/airshipctl/pkg/environment"
|
||||
"opendev.org/airship/airshipctl/pkg/log"
|
||||
)
|
||||
|
||||
// Command adds a layer to clusterctl interface with airshipctl context
|
||||
@ -48,7 +49,7 @@ func NewCommand(rs *environment.AirshipCTLSettings) (*Command, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := client.NewClient(root, rs.Debug, options)
|
||||
client, err := client.NewClient(root, log.DebugEnabled(), options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -31,6 +31,11 @@ func Init(debugFlag bool, out io.Writer) {
|
||||
airshipLog.SetOutput(out)
|
||||
}
|
||||
|
||||
// DebugEnabled returns whether the debug level is set
|
||||
func DebugEnabled() bool {
|
||||
return debug
|
||||
}
|
||||
|
||||
// Debug is a wrapper for log.Debug
|
||||
func Debug(v ...interface{}) {
|
||||
if debug {
|
||||
|
@ -175,7 +175,7 @@ func (p *Cmd) Exec(name string) error {
|
||||
return
|
||||
}
|
||||
executor.Run(runCh, ifc.RunOptions{
|
||||
Debug: p.Debug,
|
||||
Debug: log.DebugEnabled(),
|
||||
DryRun: p.DryRun,
|
||||
})
|
||||
}()
|
||||
|
Loading…
x
Reference in New Issue
Block a user