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

Add debug logging to help with troubleshooting #220

Merged
merged 1 commit into from
Jan 13, 2023
Merged

Add debug logging to help with troubleshooting #220

merged 1 commit into from
Jan 13, 2023

Conversation

stmcginnis
Copy link
Contributor

Issue #, if available:

Related: #216

Description of changes:

This adds a --verbose flag to the CLI to enable debug level log output. This can be useful when something is failing or taking a long time. With normal execution there is no indication of what is happening. This will at least give some sort of troubleshooting step a user can take to help triage what is happening.

Testing

Performed all commands with and without the --verbose flag and verified proper operation and output.

Also verified the use of the RUST_LOG environment variable to enable other tracing that could be useful for developers troubleshooting issues:

$ RUST_LOG=aws_config=debug cargo run --bin coldsnap -- upload /tmp/1000604764 
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/coldsnap upload /tmp/1000604764`
[INFO ] load_region; provider=EnvironmentVariableRegionProvider { env: Env(Real) }
[INFO ] load_region; provider=ProfileFileRegionProvider { fs: Fs(Real), env: Env(Real), profile_override: None }
[DEBUG] loaded home directory src="HOME"
[DEBUG] performing home directory substitution home="/home/stmcg" path="~/.aws/config"
[DEBUG] home directory expanded before="~/.aws/config" after="/home/stmcg/.aws/config"
[DEBUG] config file loaded path=~/.aws/config size=29
...

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@stmcginnis
Copy link
Contributor Author

Package version conflicts in dependencies.

I see we already have tracing as a dependency of a dependency, so I'll take a look at using that directly rather than bringing in the logging packages.

@stmcginnis stmcginnis marked this pull request as draft December 23, 2022 19:28
@stmcginnis stmcginnis marked this pull request as ready for review December 23, 2022 20:41
This adds a `--verbose` flag to the CLI to enable debug level log
output. This can be useful when something is failing or taking a long
time. With normal execution there is no indication of what is happening.
This will at least give some sort of troubleshooting step a user can
take to help triage what is happening.

Signed-off-by: Sean McGinnis <stmcg@amazon.com>
Copy link
Contributor

@ecpullen ecpullen left a comment

Choose a reason for hiding this comment

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

LGTM

@stmcginnis stmcginnis merged commit 04e4948 into awslabs:develop Jan 13, 2023
@stmcginnis stmcginnis deleted the tracing branch January 13, 2023 16:31
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.

3 participants