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

[TASK] Replace Logger with tracing #260

Open
Serial-ATA opened this issue Sep 9, 2024 · 2 comments · May be fixed by #311
Open

[TASK] Replace Logger with tracing #260

Serial-ATA opened this issue Sep 9, 2024 · 2 comments · May be fixed by #311
Assignees

Comments

@Serial-ATA
Copy link
Contributor

Serial-ATA commented Sep 9, 2024

Overview

Logger is simply a wrapper around log with a given ID: https://github.com/webb-tools/gadget/blob/main/common/src/debug_logger.rs

This can be replaced with tracing, which would allow us to provide that additional context, while also being able to:

  • Stop manually calling format!()
  • Stop having to pass a struct around everywhere we want logging
@Tjemmmic
Copy link
Contributor

@Serial-ATA We had some other code for logging in the past, but it was removed because it wasn't being used. Linking in case it is of use. Here is a past commit with it

@tbraun96
Copy link
Collaborator

If we don't pass around the Logger everywhere, we will still end up having to pass relevant vars elsewhere. Make sure, especially for testing, the first data we see is the name of the log (e.g., "Alice", "Bob", "Integration Test", "Blueprint-Manager-Alice", "Gadget-Alice", etc). Otherwise, what we have works and makes it easy and clear to follow. It also allows us to print to a file if needed (we use to have this, but keeping Logger allows us to easily do this) to separate logs between all the nodes when debugging. This makes causality easy to follow in a side-by-side comparison.

@Serial-ATA Serial-ATA linked a pull request Sep 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Building 🏗️
Development

Successfully merging a pull request may close this issue.

3 participants