Skip to content

Commit

Permalink
checker: change logger
Browse files Browse the repository at this point in the history
  • Loading branch information
xtuc committed May 5, 2020
1 parent aa79553 commit 3ba9f62
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions cmd/checker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ func main() {
fmt.Println("Running in debug mode")
}

// change output for readability in CI
util.SetLoggerFlag(0)

if subcommand == "lint" {
lintPackage(flag.Arg(1))

Expand All @@ -34,9 +37,19 @@ func main() {
return
}

if subcommand == "show-files" {
showFiles(flag.Arg(1))
return
}

panic("unknown subcommand")
}

func showFiles(path string) {
ctx := util.ContextWithName(path)
err(ctx, "not implemented yet")
}

func lintPackage(path string) {
ctx := util.ContextWithName(path)

Expand Down
4 changes: 0 additions & 4 deletions util/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ func GetBotBasePath() string {
return GetEnv("BOT_BASE_PATH")
}

func GetCDNJSPath() string {
return path.Join(GetBotBasePath(), "cdnjs")
}

func GetCDNJSPackages() string {
return path.Join(GetBotBasePath(), "cdnjs", "ajax", "libs")
}
4 changes: 4 additions & 0 deletions util/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ func Debugf(ctx context.Context, format string, v ...interface{}) {
Printf(ctx, format, v...)
}
}

func SetLoggerFlag(f int) {
logger.SetFlags(f)
}

0 comments on commit 3ba9f62

Please sign in to comment.