[config] improve logging and default command

This commit is contained in:
Alex Quick
2017-05-04 22:41:32 -04:00
parent 8b90d4ebf9
commit 08aa2b9fa4
5 changed files with 77 additions and 11 deletions

View File

@@ -150,3 +150,32 @@ func PlugnTrigger(triggerName string, args ...string) (string, error) {
res, err := sh.Command("plugn", "trigger", triggerName, args).Output()
return string(res), err
}
// LogInfo1 is the info1 header formatter
func LogInfo1(text string) {
fmt.Fprintln(os.Stdout, fmt.Sprintf("-----> %s", text))
}
// LogInfo1Quiet is the info1 header formatter (with quiet option)
func LogInfo1Quiet(text string) {
if os.Getenv("DOKKU_QUIET_OUTPUT") != "" {
LogInfo1(text)
}
}
// LogInfo2 is the info2 header formatter
func LogInfo2(text string) {
fmt.Fprintln(os.Stdout, fmt.Sprintf("=====> %s", text))
}
// LogInfo2Quiet is the info2 header formatter (with quiet option)
func LogInfo2Quiet(text string) {
if os.Getenv("DOKKU_QUIET_OUTPUT") != "" {
LogInfo2(text)
}
}
// LogWarn is the warning log formatter
func LogWarn(text string) {
fmt.Fprintln(os.Stderr, fmt.Sprintf(" ! %s", text))
}