@@ -6,13 +6,12 @@ import (
66 "strings"
77 "time"
88
9- "github.com/deis/pkg/prettyprint"
10-
119 "github.com/deis/controller-sdk-go/api"
1210 "github.com/deis/controller-sdk-go/apps"
1311 "github.com/deis/controller-sdk-go/config"
1412 "github.com/deis/controller-sdk-go/domains"
1513 "github.com/deis/workflow-cli/pkg/git"
14+ "github.com/deis/workflow-cli/pkg/logging"
1615 "github.com/deis/workflow-cli/pkg/webbrowser"
1716 "github.com/deis/workflow-cli/settings"
1817)
@@ -177,20 +176,8 @@ func AppLogs(appID string, lines int) error {
177176 return err
178177 }
179178
180- return printLogs (logs )
181- }
182-
183- // printLogs prints each log line with a color matched to its category.
184- func printLogs (logs string ) error {
185- for _ , log := range strings .Split (logs , `\n` ) {
186- category := "unknown"
187- parts := strings .Split (strings .Split (log , " -- " )[0 ], " " )
188- category = parts [0 ]
189- colorVars := map [string ]string {
190- "Color" : chooseColor (category ),
191- "Log" : log ,
192- }
193- fmt .Println (prettyprint .ColorizeVars ("{{.V.Color}}{{.V.Log}}{{.C.Default}}" , colorVars ))
179+ for _ , log := range strings .Split (strings .TrimRight (logs , `\n` ), `\n` ) {
180+ logging .PrintLog (os .Stdout , log )
194181 }
195182
196183 return nil
0 commit comments