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

Added -verbose=true cli flag #61

Closed

Conversation

shlomimatichin
Copy link
Contributor

@shlomimatichin shlomimatichin commented Oct 11, 2020

Added -verbose=true cli flag, [DEBUG] messages off by default
Note that tfschema RPC clients still bypass this filter, since each creates a logger itself... submitting a patch to tfschema to request this changed.
resolves #60

@shlomimatichin
Copy link
Contributor Author

this regarding issue #60

Copy link
Contributor

@roni-frantchi roni-frantchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shlomimatichin looks very good to me.
Do have one minor comment - address at your discretion.
Other than that, we should probably update the readme with that flag.

Comment on lines +29 to +37
filter := &logutils.LevelFilter{
Levels: []logutils.LogLevel{"DEBUG", "TRACE", "INFO", "WARN", "ERROR"},
MinLevel: logutils.LogLevel("INFO"),
Writer: os.Stderr,
}
if args.Verbose {
filter.MinLevel = logutils.LogLevel("DEBUG")
}
log.SetOutput(filter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should extract these to a named function -

  1. It'd give a header to what's being done
  2. Perhaps that function would be where we set the log level for tfschema

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. will do post merge, since #62 continues where this pull request ends.

@shlomimatichin shlomimatichin deleted the non_verbose_logging branch October 13, 2020 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let terratag users control log-level
2 participants