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

fix: improve logs #73

Merged
merged 1 commit into from
Jun 3, 2024
Merged

fix: improve logs #73

merged 1 commit into from
Jun 3, 2024

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented May 31, 2024

Example output before my change:

Retrieval failed with status code 502: no candidates found

{
  timeout: false,
  startAt: 2024-05-31T07:30:43.389Z,
  // etc.
  protocol: "graphsync",
  providerAddress: "/ip4/118.212.68.22/tcp/24501/p2p/12D3KooWJJEL214g7yMFMFaE6aPRaQTLVVCNFjWeiBLUCTzP98tp"
}
Submitting measurement...
{
  sparkVersion: "1.11.4",
  zinniaVersion: "0.19.1",
  cid: "bafykbzacechhbxnsn5dw6lx7phcfvkjc6kqsuuwl4bnynexewb5y3vtcw2fvw",
  minerId: "f02894875",
  timeout: false,
  startAt: 2024-05-31T07:30:43.389Z,
  // etc.
  providerAddress: "/ip4/118.212.68.22/tcp/24501/p2p/12D3KooWJJEL214g7yMFMFaE6aPRaQTLVVCNFjWeiBLUCTzP98tp",
  participantAddress: "0x000000000000000000000000000000000000dEaD",
  stationId: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}

This commit removes the first log which was printed when fetch() was able to get some HTTP response frome the server.

It is also removing the trailing newline from HTTP error response bodies before we print them to the console.

Finally, it adds an empty line between tasks, to visually delimit logs belonging to different tasks.

Example output before my change:

```
Retrieval failed with status code 502: no candidates found

{
  timeout: false,
  startAt: 2024-05-31T07:30:43.389Z,
  // etc.
  protocol: "graphsync",
  providerAddress: "/ip4/118.212.68.22/tcp/24501/p2p/12D3KooWJJEL214g7yMFMFaE6aPRaQTLVVCNFjWeiBLUCTzP98tp"
}
Submitting measurement...
{
  sparkVersion: "1.11.4",
  zinniaVersion: "0.19.1",
  cid: "bafykbzacechhbxnsn5dw6lx7phcfvkjc6kqsuuwl4bnynexewb5y3vtcw2fvw",
  minerId: "f02894875",
  timeout: false,
  startAt: 2024-05-31T07:30:43.389Z,
  // etc.
  providerAddress: "/ip4/118.212.68.22/tcp/24501/p2p/12D3KooWJJEL214g7yMFMFaE6aPRaQTLVVCNFjWeiBLUCTzP98tp",
  participantAddress: "0x000000000000000000000000000000000000dEaD",
  stationId: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
```

This commit removes the first log which was printed when `fetch()`
was able to get some HTTP response frome the server.

It is also removing the trailing newline from HTTP error response bodies
before we print them to the console.

Finally, it adds an empty line between tasks, to visually delimit
logs belonging to different tasks.
@bajtos bajtos requested a review from juliangruber May 31, 2024 07:43
@bajtos
Copy link
Member Author

bajtos commented May 31, 2024

@juliangruber feel free to land & release this change yourself, if you have time & appetite.

@juliangruber juliangruber merged commit 2e47236 into main Jun 3, 2024
1 check passed
@juliangruber juliangruber deleted the less-logs branch June 3, 2024 10:59
@juliangruber
Copy link
Member

https://github.com/filecoin-station/spark/releases/tag/v1.12.0

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

Successfully merging this pull request may close these issues.

2 participants