Compare commits

..

No commits in common. "d9f25a26138094e3f501467af29fbe7976ec7000" and "1c9f8398706dbb8c7c38f1d643660bc7a370d5e6" have entirely different histories.

2 changed files with 17 additions and 4 deletions

19
main.go
View File

@ -55,14 +55,14 @@ func init() {
}
func main() {
log.SetFormatter(&log.TextFormatter{
DisableTimestamp: true,
})
log.SetFormatter(new(formatter))
switch args.Level {
case "debug":
log.SetFormatter(textFormatter)
log.SetLevel(log.DebugLevel)
case "trace":
log.SetFormatter(textFormatter)
log.SetLevel(log.TraceLevel)
}
@ -70,3 +70,16 @@ func main() {
log.Fatalln(err)
}
}
// default formatter that writes logs without including timestamp
// or level information.
type formatter struct{}
func (*formatter) Format(entry *log.Entry) ([]byte, error) {
return []byte(entry.Message), nil
}
// text formatter that writes logs with level information
var textFormatter = &log.TextFormatter{
DisableTimestamp: true,
}

View File

@ -50,7 +50,7 @@ func SetBasicAuth(username, password string) func(repo *git.Repository) error {
func FetchTags() func(repo *git.Repository) error {
return func(repo *git.Repository) error {
log.Info("Fetching git tags")
log.Info("Fetching latest git tags")
err := repo.Fetch(&git.FetchOptions{Tags: git.AllTags})