Skip to content

Commit

Permalink
Use logger to print some debug messages than fmt.print
Browse files Browse the repository at this point in the history
  • Loading branch information
phy25 committed Mar 23, 2020
1 parent c5ed682 commit 4d461bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/tunasynctl/tunasynctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type config struct {

func loadConfig(cfgFile string, cfg *config) error {
if cfgFile != "" {
logger.Infof("Loading config: %s", cfgFile)
if _, err := toml.DecodeFile(cfgFile, cfg); err != nil {
logger.Errorf(err.Error())
return err
Expand All @@ -78,7 +79,6 @@ func initialize(c *cli.Context) error {
if _, err := os.Stat(systemCfgFile); err == nil {
loadConfig(systemCfgFile, cfg)
}
fmt.Println(os.ExpandEnv(userCfgFile))
if _, err := os.Stat(os.ExpandEnv(userCfgFile)); err == nil {
loadConfig(os.ExpandEnv(userCfgFile), cfg)
}
Expand Down Expand Up @@ -185,7 +185,7 @@ func listJobs(c *cli.Context) error {
fmt.Sprintf("Error printing out informations: %s", err.Error()),
1)
}
fmt.Printf(string(b))
fmt.Print(string(b))
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion worker/cmd_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (p *cmdProvider) Run() error {
}
if p.failOnMatch != nil {
matches, err := internal.FindAllSubmatchInFile(p.LogFile(), p.failOnMatch)
fmt.Printf("FindAllSubmatchInFile: %q\n", matches)
logger.Infof("FindAllSubmatchInFile: %q\n", matches)
if err != nil {
return err
}
Expand Down

0 comments on commit 4d461bd

Please sign in to comment.