Skip to content

Commit

Permalink
add date to logs
Browse files Browse the repository at this point in the history
  • Loading branch information
eze-kiel committed Feb 26, 2021
1 parent e63980b commit 8ffb307
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/slowql-replayer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ func main() {
logrus.Fatalf("cannot open slow query log file: %s", err)
}

logrus.Infof("starting replay")
r, err := db.replay(f)
if err != nil {
logrus.Fatalf("cannot replay %s: %s", opt.kind, err)
}
logrus.Infof("replay ended")

if opt.dryRun {
r.dryRun = "true"
Expand Down Expand Up @@ -153,6 +151,7 @@ func (db *database) replay(f io.Reader) (results, error) {
p := slowql.NewParser(db.kind, f)

start := time.Now()
logrus.Infof("replay started on %s", time.Now().Format("Mon Jan 2 15:04:05"))
s := newSpinner(34)
s.Start()

Expand Down Expand Up @@ -198,6 +197,7 @@ func (db *database) replay(f io.Reader) (results, error) {

s.Stop()
r.duration = time.Since(start)
logrus.Infof("replay ended on %s", time.Now().Format("Mon Jan 2 15:04:05"))
return r, nil
}

Expand Down

0 comments on commit 8ffb307

Please sign in to comment.