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:
@@ -19,17 +19,17 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
overlaySourceDir = overlay.OverlaySourceDir(overlayName)
|
||||
|
||||
if !util.IsDir(overlaySourceDir) {
|
||||
wwlog.Printf(wwlog.ERROR, "Overlay does not exist: %s\n", overlayName)
|
||||
wwlog.Error("Overlay does not exist: %s\n", overlayName)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
overlayDir := path.Join(overlaySourceDir, dirName)
|
||||
|
||||
wwlog.Printf(wwlog.DEBUG, "Will create directory in overlay: %s:%s\n", overlayName, dirName)
|
||||
wwlog.Debug("Will create directory in overlay: %s:%s\n", overlayName, dirName)
|
||||
|
||||
err := os.MkdirAll(overlayDir, os.FileMode(PermMode))
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Could not create directory: %s\n", path.Dir(overlayDir))
|
||||
wwlog.Error("Could not create directory: %s\n", path.Dir(overlayDir))
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user