Skip to content

Commit

Permalink
Merge pull request #41 from blp1526/remove_verbose
Browse files Browse the repository at this point in the history
Remove verbose
  • Loading branch information
blp1526 authored Dec 13, 2017
2 parents 9bc0d60 + e865e16 commit 8b08868
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 47 deletions.
20 changes: 1 addition & 19 deletions Gopkg.lock

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

4 changes: 0 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,5 @@
name = "github.com/urfave/cli"
version = "1.20.0"

[[constraint]]
name = "github.com/sirupsen/logrus"
version = "v1.0.3"

[[constraint]]
name = "github.com/nsf/termbox-go"
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ $ isac
|Name|Description|
|-|-|
|--unanonymize|unanonymize personal data|
|--verbose| print debug log|
|--zones ZONES|set ZONES (separated by ",", example: "is1a,is1b,tk1a")|
|--help, -h|show help|
|--version, -v|print the version|
17 changes: 2 additions & 15 deletions lib/isac.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/blp1526/isac/lib/row"
"github.com/mattn/go-runewidth"
"github.com/nsf/termbox-go"
"github.com/sirupsen/logrus"
)

type Isac struct {
Expand All @@ -23,7 +22,6 @@ type Isac struct {
config *config.Config
detail bool
unanonymize bool
logger *logrus.Logger
row *row.Row
// FIXME: wasteful
serverByCurrentRow map[int]server.Server
Expand All @@ -33,7 +31,7 @@ type Isac struct {
message string
}

func New(configPath string, unanonymize bool, verbose bool, zones string) (i *Isac, err error) {
func New(configPath string, unanonymize bool, zones string) (i *Isac, err error) {
config, err := config.New(configPath)
if err != nil {
return i, err
Expand All @@ -42,16 +40,6 @@ func New(configPath string, unanonymize bool, verbose bool, zones string) (i *Is
client := api.NewClient(config.AccessToken, config.AccessTokenSecret)
row := row.New()

formatter := &logrus.TextFormatter{
FullTimestamp: true,
}

logger := logrus.New()
logger.Formatter = formatter
if verbose {
logger.Level = logrus.DebugLevel
}

zs := []string{config.Zone}
if zones != "" {
zs = strings.Split(zones, ",")
Expand All @@ -62,7 +50,6 @@ func New(configPath string, unanonymize bool, verbose bool, zones string) (i *Is
config: config,
detail: false,
unanonymize: unanonymize,
logger: logger,
row: row,
zones: zs,
reverseSort: false,
Expand Down Expand Up @@ -271,7 +258,7 @@ func (i *Isac) currentServerUp() (message string) {
}

if statusCode != 200 {
return fmt.Sprintf(fmt.Sprintf("[ERROR] Request Method: PUT, Request URL: %v, Status Code: %v", url, statusCode))
return fmt.Sprintf("[ERROR] Request Method: PUT, Request URL: %v, Status Code: %v", url, statusCode)
}

return fmt.Sprintf("Server.Name %v is booting, wait few seconds, and refresh", s.Name)
Expand Down
9 changes: 1 addition & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
const ExitCodeNG = 1

var unanonymize bool
var verbose bool
var version string
var zones string

Expand All @@ -38,12 +37,6 @@ func main() {
Destination: &unanonymize,
},

cli.BoolFlag{
Name: "verbose",
Usage: "print debug log",
Destination: &verbose,
},

cli.StringFlag{
Name: "zones",
Usage: "set `ZONES` (separated by \",\", example: \"is1a,is1b,tk1a\")",
Expand All @@ -67,7 +60,7 @@ func main() {
}

app.Action = func(c *cli.Context) (err error) {
i, err := isac.New(configPath, unanonymize, verbose, zones)
i, err := isac.New(configPath, unanonymize, zones)
if err != nil {
return cli.NewExitError(fmt.Sprintf("%v", err), ExitCodeNG)
}
Expand Down

0 comments on commit 8b08868

Please sign in to comment.