Skip to content

Commit

Permalink
using apex instead of logrus
Browse files Browse the repository at this point in the history
  • Loading branch information
Italo Vietro committed Jul 12, 2018
1 parent 2912e5c commit 67e3f75
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 41 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: go
go: 1.10
install: make setup
script: make test
after_success:
# - go get github.com/mattn/goveralls
# - goveralls -coverprofile=coverage.out -service=travis-ci -repotoken="$COVERALLS_TOKEN"
- test -n "$TRAVIS_TAG" && curl -sL http://git.io/goreleaser | bash
notifications:
email: false
46 changes: 26 additions & 20 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 6 additions & 14 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
name = "github.com/gojektech/heimdall"
version = "3.0.1"

[[constraint]]
branch = "master"
name = "github.com/hashicorp/errwrap"

[[constraint]]
branch = "master"
name = "github.com/mitchellh/go-homedir"

[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.5"
Expand All @@ -46,17 +38,17 @@
version = "0.0.3"

[[constraint]]
name = "github.com/spf13/viper"
version = "1.0.2"
name = "github.com/tcnksm/go-httpstat"
version = "0.2.0"

[prune]
go-tests = true
unused-packages = true

[[constraint]]
branch = "master"
name = "golang.org/x/sync"
name = "github.com/stretchr/testify"
version = "1.2.2"

[[constraint]]
name = "github.com/tcnksm/go-httpstat"
version = "0.2.0"
name = "github.com/apex/log"
version = "1.0.0"
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ WARN_COLOR=\033[33;01m
# If you change this, run `make clean`.
PKG_SRC := github.com/italolelis/reachable

.PHONY: all clean deps build
.PHONY: all clean setup build

all: clean deps test build
all: clean setup test build

deps:
setup:
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)"
@go get -u github.com/golang/dep/cmd/dep
@go get -u github.com/golang/lint/golint
Expand Down
8 changes: 4 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"time"

"github.com/italolelis/reachable/pkg/log"
"github.com/sirupsen/logrus"
"github.com/apex/log"
logCtx "github.com/italolelis/reachable/pkg/log"
"github.com/spf13/cobra"
)

Expand All @@ -20,14 +20,14 @@ type (
// NewRootCmd creates the root command
func NewRootCmd() *cobra.Command {
opts := RootOptions{}
ctx := log.NewContext(context.Background())
ctx := logCtx.NewContext(context.Background())

cmd := cobra.Command{
Use: "reachable",
Short: "Reachable is a CLI tool to check if a domain is up",
PersistentPreRun: func(ccmd *cobra.Command, args []string) {
if opts.verbose {
log.WithContext(context.Background()).SetLevel(logrus.DebugLevel)
log.SetLevel(log.DebugLevel)
}
},
}
Expand Down

0 comments on commit 67e3f75

Please sign in to comment.