X-Git-Url: https://ruderich.org/simon/gitweb/?p=safcm%2Fsafcm.git;a=blobdiff_plain;f=cmd%2Fsafcm%2Fsync.go;h=f1877cffde6b9b42b18955587192a19fda43127d;hp=10edc68755e98c81e2c890745d3e3f706d3a3691;hb=ecbcb0132728cc18016819a214378b642d92278e;hpb=b0f49e5d47786984e24731b200d3d3d7d6add263 diff --git a/cmd/safcm/sync.go b/cmd/safcm/sync.go index 10edc68..f1877cf 100644 --- a/cmd/safcm/sync.go +++ b/cmd/safcm/sync.go @@ -214,11 +214,11 @@ are only available after the hosts were contacted. func logEvent(x frontend.Event, level safcm.LogLevel, isTTY bool, failed *bool) { // We have multiple event sources so this is somewhat ugly. var prefix, data string - var color Color + var color frontend.Color if x.Error != nil { prefix = "[error]" data = x.Error.Error() - color = ColorRed + color = frontend.ColorRed // We logged an error, tell the caller *failed = true } else if x.Log.Level != 0 { @@ -237,7 +237,7 @@ func logEvent(x frontend.Event, level safcm.LogLevel, isTTY bool, failed *bool) prefix = "[debug2]" default: prefix = fmt.Sprintf("[INVALID=%d]", x.Log.Level) - color = ColorRed + color = frontend.ColorRed } data = x.Log.Text } else { @@ -254,19 +254,19 @@ func logEvent(x frontend.Event, level safcm.LogLevel, isTTY bool, failed *bool) x.ConnEvent.Data = "remote helper upload in progress" default: prefix = fmt.Sprintf("[INVALID=%d]", x.ConnEvent.Type) - color = ColorRed + color = frontend.ColorRed } data = x.ConnEvent.Data } host := x.Host.Name() if color != 0 { - host = ColorString(isTTY, color, host) + host = frontend.ColorString(isTTY, color, host) } // Make sure to escape control characters to prevent terminal // injection attacks if !x.Escaped { - data = EscapeControlCharacters(isTTY, data) + data = frontend.EscapeControlCharacters(isTTY, data) } log.Printf("%-9s [%s] %s", prefix, host, data) }