Replace all instances of wwlog.Printf
wwlog provides named loggers for each level, which requires less code and is clearer than wwlog.Printf. The code has included a mix of both, but this commit consolidates existing code on the per-level functions. Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
@@ -17,13 +17,13 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
|
||||
nodeDB, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Could not open node configuration: %s\n", err)
|
||||
wwlog.Error("Could not open node configuration: %s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
nodes, err := nodeDB.FindAllNodes()
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Cloud not get nodeList: %s\n", err)
|
||||
wwlog.Error("Cloud not get nodeList: %s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
for _, node := range nodes {
|
||||
|
||||
if node.Ipmi.Ipaddr.Get() == "" {
|
||||
wwlog.Printf(wwlog.ERROR, "%s: No IPMI IP address\n", node.Id.Get())
|
||||
wwlog.Error("%s: No IPMI IP address\n", node.Id.Get())
|
||||
continue
|
||||
}
|
||||
var ipmiInterface = "lan"
|
||||
@@ -85,7 +85,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
out, err := result.Result()
|
||||
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "%s: %s\n", result.NodeName, out)
|
||||
wwlog.Error("%s: %s\n", result.NodeName, out)
|
||||
returnErr = err
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user