Add Warningf to logger interface amd impl

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
pull/1222/head
Stefan Prodan 4 years ago
parent 8b5583930e
commit 74feda73af
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF

@ -241,6 +241,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
secretOpts.Password = sourceGitArgs.password
secretOpts.CAFilePath = sourceGitArgs.caFile
case "http":
logger.Warningf("insecure configuration: credentials configured for an HTTP URL")
secretOpts.Username = sourceGitArgs.username
secretOpts.Password = sourceGitArgs.password
}

@ -41,6 +41,10 @@ func (l stderrLogger) Successf(format string, a ...interface{}) {
fmt.Fprintln(l.stderr, ``, fmt.Sprintf(format, a...))
}
func (l stderrLogger) Warningf(format string, a ...interface{}) {
fmt.Fprintln(l.stderr, `⚠️`, fmt.Sprintf(format, a...))
}
func (l stderrLogger) Failuref(format string, a ...interface{}) {
fmt.Fprintln(l.stderr, ``, fmt.Sprintf(format, a...))
}

@ -24,6 +24,8 @@ type Logger interface {
Waitingf(format string, a ...interface{})
// Successf logs a formatted success message.
Successf(format string, a ...interface{})
// Warningf logs a formatted warning message.
Warningf(format string, a ...interface{})
// Failuref logs a formatted failure message.
Failuref(format string, a ...interface{})
}

Loading…
Cancel
Save