Add LogSuccess
This commit is contained in:
@@ -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))
|
||||
|
||||
|
@@ -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...)
|
||||
|
Reference in New Issue
Block a user