Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable DEBUG and INFO #41

Closed
memark opened this issue Nov 29, 2021 · 4 comments · Fixed by #42
Closed

How to disable DEBUG and INFO #41

memark opened this issue Nov 29, 2021 · 4 comments · Fixed by #42

Comments

@memark
Copy link

memark commented Nov 29, 2021

This tool works nicely!

But there is a lot of noise in the output:

2021/11/29 08:45:26 gowatch.go:113: [INFO] Start building...
2021/11/29 08:45:26 gowatch.go:150: [INFO] Build Args: go build -o ./00
2021/11/29 08:45:26 gowatch.go:158: [INFO] Build was successful
2021/11/29 08:45:26 gowatch.go:193: [DEBUG] main pid: 6059
2021/11/29 08:45:26 gowatch.go:194: [DEBUG] pids: []
2021/11/29 08:45:26 gowatch.go:205: [DEBUG] killing MAIN process pid: 6059
❯ gowatch -v
1.5

Is there a config setting to disable the printing of DEBUG and INFO lines?
I find they take too much focus from the output from my actual program. (ERROR lines are still useful.)

@silenceper
Copy link
Owner

Thanks for the feedback.

Currently does not support custom log output level, but I will add the change function later.

@silenceper
Copy link
Owner

@memark
two way can custom log level:

  • add -l flag, like gowatch -l error
  • set log_level field in the gowatch.yml
Usage of gowatch:

If no command is provided gowatch will start the runner with the provided flags

Commands:
  init  creates a gowatch.yml file with default settings to the current directory

Flags:
  -args string
    	app run args,separated by commas. like: -args='-host=:8080,-name=demo'
  -h	help
  -l string
    	log level: debug, info, warn, error, fatal
  -o string
    	go build output
  -p string
    	go build packages
  -v	show version

@silenceper
Copy link
Owner

@memark
Copy link
Author

memark commented Dec 3, 2021

@silenceper Excellent, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants