Skip to content

Commit

Permalink
log/log: Use internal logger
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <a.jung@lancs.ac.uk>
  • Loading branch information
nderjung committed Dec 20, 2020
1 parent f33a3d3 commit 41143b8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
10 changes: 2 additions & 8 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"os"
"fmt"

log "github.com/sirupsen/logrus"
"github.com/lancs-net/ukbench/log"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -78,14 +78,8 @@ func init() {

// initLogging prepares logrus with sensible defaults
func initLogging(verbose bool) {
// Output to stdout instead of the default stderr
// Can be any io.Writer, see below for File example
log.SetOutput(os.Stdout)

// Only log the warning severity or above.
if verbose {
log.SetLevel(log.DebugLevel)
} else {
log.SetLevel(log.WarnLevel)
log.SetLevel(log.DEBUG)
}
}
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"os/signal"

"github.com/spf13/cobra"
log "github.com/sirupsen/logrus"
"github.com/lancs-net/ukbench/log"

"github.com/lancs-net/ukbench/job"
"github.com/lancs-net/ukbench/run"
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/lancs-net/ukbench
go 1.14

require (
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cobra v1.1.1
gopkg.in/yaml.v2 v2.2.8
)
2 changes: 1 addition & 1 deletion job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"io/ioutil"

"gopkg.in/yaml.v2"
log "github.com/sirupsen/logrus"
"github.com/lancs-net/ukbench/log"
)

type JobParam struct {
Expand Down
2 changes: 2 additions & 0 deletions job/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ package job
import (
"fmt"
"sync"

"github.com/lancs-net/ukbench/log"
)

// CoreMap holds onto to a reference to the particular task which is currently
Expand Down
2 changes: 2 additions & 0 deletions job/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (
"io"
"fmt"
"crypto/md5"

"github.com/lancs-net/ukbench/log"
)

type TaskParam struct {
Expand Down
2 changes: 1 addition & 1 deletion run/prep.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"strings"
"io/ioutil"

log "github.com/sirupsen/logrus"
"github.com/lancs-net/ukbench/log"
)

type ProcValue struct {
Expand Down

0 comments on commit 41143b8

Please sign in to comment.