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

Log when pinging #81

Closed
wants to merge 6 commits into from
Closed

Log when pinging #81

wants to merge 6 commits into from

Conversation

kihehs
Copy link
Contributor

@kihehs kihehs commented Sep 26, 2023

This helps us determine if the token is correct.

@alexespencer alexespencer requested a review from Tpt September 26, 2023 09:19
@@ -75,6 +75,11 @@ impl Artifactory {
};

let status = response.status();

if !status.is_success() {
tracing::info!(response_header=?response.headers());
Copy link
Contributor

Choose a reason for hiding this comment

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

debug maybe?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we use debug we may need to override RUST_LOG env var in CI - hopefully this should be possible?

Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to consider the debug string too:

Suggested change
tracing::info!(response_header=?response.headers());
tracing::debug!("artifactory response: {:?}", response);

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. You have an example here:

RUST_BACKTRACE: 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're trying to fix a bug that only appears in CI, and I'm not sure how to override RUST_LOG there.

Copy link
Contributor Author

@kihehs kihehs Sep 26, 2023

Choose a reason for hiding this comment

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

Regarding debug!, I don't see my debug logs when I run this. I seem to remember a lot of custom initialization being done to tracing_subscriber:

RUST_LOG=debug cargo run -- login --registry https://my-registry...
export RUST_LOG=debug; cargo run -- login --registry https://my-registry...

(This doesn't change with RUST_BACKTRACE=1)

@kihehs
Copy link
Contributor Author

kihehs commented Sep 26, 2023

Closing because another merge breaks this PR pretty badly.

@kihehs kihehs closed this Sep 26, 2023
@mara-schulke mara-schulke deleted the kh/better-login-logging branch October 4, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants