From f5c71ee915f2ea0ef14a1be3544baf923cf85851 Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Wed, 20 Mar 2024 17:51:30 +0100 Subject: [PATCH] chore: logging output cleanup --- internal/configs/config_bootloaders.go | 2 +- internal/configs/configs.go | 2 +- internal/pages/06_finalize.go | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/configs/config_bootloaders.go b/internal/configs/config_bootloaders.go index cf76100..f7e6807 100644 --- a/internal/configs/config_bootloaders.go +++ b/internal/configs/config_bootloaders.go @@ -211,7 +211,7 @@ func Set_Grub2() ([]string, error) { sysfile := sysfile_re.ReplaceAllString(conffile, "") // Write to logger - logger.Printf("Executing command:\nsudo cp -v \"%s\" %s", conffile, sysfile) + logger.Printf("Executing command:\nsudo cp -v \"%s\" %s\n", conffile, sysfile) // Make our output slice var output []string diff --git a/internal/configs/configs.go b/internal/configs/configs.go index 351169e..fa0ab87 100644 --- a/internal/configs/configs.go +++ b/internal/configs/configs.go @@ -244,7 +244,7 @@ func CopyToSystem(conffile, sysfile string) string { clean_output := clean_re.ReplaceAllString(output[0], "") // Write output to logger - logger.Printf(clean_output) + logger.Printf("%s\n", clean_output) // Return the output return fmt.Sprintf("Copying: %s", clean_output) diff --git a/internal/pages/06_finalize.go b/internal/pages/06_finalize.go index 95b71c9..3aebd92 100644 --- a/internal/pages/06_finalize.go +++ b/internal/pages/06_finalize.go @@ -40,7 +40,7 @@ func prepModules(config *configs.Config) { // Configure grub2 here as we can make the config without sudo if config.Bootloader == "grub2" { // Write to logger - logger.Printf("Configuring grub2 manually") + logger.Printf("Configuring grub2 manually\n") configs.Configure_Grub2() } @@ -117,7 +117,7 @@ func installPassthrough(config *configs.Config) { // Based on the bootloader, setup the configuration if config.Bootloader == "kernelstub" { // Write to logger - logger.Printf("Configuring systemd-boot using kernelstub") + logger.Printf("Configuring systemd-boot using kernelstub\n") // Configure kernelstub output = configs.Set_KernelStub() @@ -125,7 +125,7 @@ func installPassthrough(config *configs.Config) { } else if config.Bootloader == "grubby" { // Write to logger - logger.Printf("Configuring bootloader using grubby") + logger.Printf("Configuring bootloader using grubby\n") // Configure kernelstub output = configs.Set_Grubby() @@ -133,7 +133,7 @@ func installPassthrough(config *configs.Config) { } else if config.Bootloader == "grub2" { // Write to logger - logger.Printf("Applying grub2 changes") + logger.Printf("Applying grub2 changes\n") grub_output, _ := configs.Set_Grub2() fmt.Printf("%s\n", strings.Join(grub_output, "\n")) @@ -164,7 +164,7 @@ func installPassthrough(config *configs.Config) { fmt.Printf("%s\n", output) // Write to logger - logger.Printf("Executing: sudo update-initramfs -u") + logger.Printf("Executing: sudo update-initramfs -u\n") // Update initramfs fmt.Println("Executed: sudo update-initramfs -u\nSee debug.log for detailed output") @@ -183,7 +183,7 @@ func installPassthrough(config *configs.Config) { sysinfo := uname.New() // Write to logger - logger.Printf("Executing: sudo dracut -f -v --kver %s", sysinfo.Release) + logger.Printf("Executing: sudo dracut -f -v --kver %s\n", sysinfo.Release) // Update initramfs fmt.Printf("Executed: sudo dracut -f -v --kver %s\nSee debug.log for detailed output", sysinfo.Release)