Skip to content

Commit

Permalink
make logging consistent with current
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Jansson <[email protected]>
  • Loading branch information
andreasjansson committed Jan 6, 2021
1 parent 5af9906 commit 7802941
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions go/pkg/console/global.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package console

import (
"fmt"
"os"

"github.com/mattn/go-isatty"
)

const truncateLength = 80

// ConsoleInstance is the global instance of console, so we don't have to pass it around everywhere
var ConsoleInstance *Console = &Console{
Color: true,
Expand Down Expand Up @@ -69,11 +66,3 @@ func DebugOutput(line string) {
func IsTTY() bool {
return isatty.IsTerminal(os.Stdout.Fd())
}

func Truncate(msg string, v ...interface{}) string {
s := fmt.Sprintf(msg, v...)
if len(s) > truncateLength && truncateLength > 3 {
return s[:truncateLength-3] + "..."
}
return s
}
4 changes: 2 additions & 2 deletions go/pkg/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (p *Project) CreateExperiment(args CreateExperimentArgs, async bool, workCh
return err
}
if !quiet {
console.Info(console.Truncate("Created experiment %s, copied the files from %s to %s/%s", exp.ShortID(), exp.Path, p.repository.RootURL(), exp.StorageTarPath()))
console.Info("Created experiment %s, copied '%s' to '%s'...", exp.ShortID(), exp.Path, p.repository.RootURL())
}
return nil
}
Expand Down Expand Up @@ -298,7 +298,7 @@ func (p *Project) CreateCheckpoint(args CreateCheckpointArgs, async bool, workCh
return err
}
if !quiet {
console.Info(console.Truncate("Created checkpoint %s, copied the files from %s to %s/%s", chk.ShortID(), chk.Path, p.repository.RootURL(), chk.StorageTarPath()))
console.Info("Created checkpoint %s, copied '%s' to '%s'...", chk.ShortID(), chk.Path, p.repository.RootURL())
}
return nil
}
Expand Down

0 comments on commit 7802941

Please sign in to comment.