diff --git a/instruction.go b/instruction.go index 5b94134..d8bba5a 100644 --- a/instruction.go +++ b/instruction.go @@ -74,6 +74,7 @@ func (instruction *LinkInstruction) Undo() { LogError("could not remove symlink at %s; err: %v", FormatTargetPath(instruction.Target), err) } + LogSuccess("Removed symlink at %s", FormatTargetPath(instruction.Target)) } else { LogInfo("%s is not a symlink, skipping", FormatTargetPath(instruction.Target)) } @@ -254,7 +255,7 @@ func (instruction *LinkInstruction) RunAsync(status chan (error)) { err) return } - LogInfo("Created symlink between %s and %s", + LogSuccess("Created symlink between %s and %s", FormatSourcePath(instruction.Source), FormatTargetPath(instruction.Target)) diff --git a/logger.go b/logger.go index a32036b..43108cc 100644 --- a/logger.go +++ b/logger.go @@ -14,6 +14,7 @@ const ( TargetPrefix = "TARGET" PathPrefix = "PATH" ImportantPrefix = "IMPORTANT" + SuccessPrefix = "DONE" ) // LogInfo logs an informational message @@ -22,6 +23,12 @@ func LogInfo(format string, args ...interface{}) { log.Printf("%s[%s]%s %s", BGreen, InfoPrefix, Reset, message) } +// LogSuccess logs a success message +func LogSuccess(format string, args ...interface{}) { + message := fmt.Sprintf(format, args...) + log.Printf("%s%s[%s]%s %s", BBlue, On_Blue, SuccessPrefix, Reset, message) +} + // LogSource logs a message about a source file/path with proper coloring func LogSource(format string, args ...interface{}) { message := fmt.Sprintf(format, args...)