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

Replace logging package with corelog #2405

Closed
nasdf opened this issue Mar 13, 2024 · 0 comments · Fixed by #2406
Closed

Replace logging package with corelog #2405

nasdf opened this issue Mar 13, 2024 · 0 comments · Fixed by #2406
Assignees
Labels
area/logging Related to the logging/logger system
Milestone

Comments

@nasdf
Copy link
Member

nasdf commented Mar 13, 2024

Standardize logs by using the corelog library.

@nasdf nasdf added the area/logging Related to the logging/logger system label Mar 13, 2024
@nasdf nasdf added this to the DefraDB v0.11 milestone Mar 13, 2024
@nasdf nasdf self-assigned this Mar 13, 2024
nasdf added a commit that referenced this issue Mar 19, 2024
## Relevant issue(s)

Resolves #2405

## Description

This PR replaces the logging package with the `corelog` library.

Please review along with sourcenetwork/corelog#2

`corelog` utilizes the `log/slog` standard library package to produce
structured logs.

The interface is kept mostly the same with some modifications:

- `Debug` and `Fatal` levels have been removed
- `context` for logging calls has been moved to a context specific
variant. For example `Info` has a `InfoContext` variant.
- `Feedback` methods have been removed in favor of restricting the
output to `stderr` and `stdout`.
- Supported output formats are `text` or `json`. `csv` is not supported
by `slog`
- Support for colored logs is not yet implemented, but can be easily
added in a future PR.

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

Manually tested

Specify the platform(s) on which this was tested:
- MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging Related to the logging/logger system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant