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

improve log levels #1098

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

improve log levels #1098

wants to merge 2 commits into from

Conversation

JssDWt
Copy link
Contributor

@JssDWt JssDWt commented Oct 7, 2024

Logs currently contain unuseful sections like below, cluttering the logs.
This PR sets the default log level to info, and all sdk related loglevels to debug.

[BreezSdk] {CONFIG} (2024-10-07T14:17:08.170036Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.200344Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.218030Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.253748Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.272098Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.307360Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.329893Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.356449Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.369552Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.398529Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.412128Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.442880Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.452913Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.483022Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.494048Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.531994Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.543038Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.578944Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.589314Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.620291Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.629984Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.663966Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.673143Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.708896Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.720016Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.759743Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.772713Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.805306Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.814986Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.848213Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.857246Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.885252Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.893643Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.929084Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.941174Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.977456Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:08.995694Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:09.030732Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:09.060805Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:09.090097Z) : received frame=Data { stream_id: StreamId(3) }
[BreezSdk] {CONFIG} (2024-10-07T14:17:09.128401Z) : received frame=Data { stream_id: StreamId(3) }

@JssDWt JssDWt requested review from roeierez and ok300 October 7, 2024 18:57
@erdemyerebasmaz
Copy link
Contributor

Related: #874

@@ -40,7 +40,7 @@ pub async fn get_and_log_response(
let response = get_reqwest_client()?.get(url).send().await?;
let status = response.status();
let raw_body = response.text().await?;
debug!("Received response, status: {status}, raw response body: {raw_body}");
trace!("Received response, status: {status}, raw response body: {raw_body}");
Copy link
Member

Choose a reason for hiding this comment

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

perhaps log the status only on debug? It is very helpful to understand if the chain service failed or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the response status a debug log and the raw body a trace log

libs/sdk-core/src/breez_services.rs Show resolved Hide resolved
Copy link
Member

@roeierez roeierez left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants