-
Notifications
You must be signed in to change notification settings - Fork 382
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
feat: standardize logging #1302
Conversation
Things we need to agree on:
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1302 +/- ##
==========================================
+ Coverage 55.80% 56.05% +0.24%
==========================================
Files 435 436 +1
Lines 66056 66498 +442
==========================================
+ Hits 36863 37274 +411
- Misses 26320 26325 +5
- Partials 2873 2899 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pinging @moul to take a look at the discussions 🙏 |
I've added a small go mod tidy script: |
Signed-off-by: gfanton <[email protected]>
Signed-off-by: gfanton <[email protected]>
Signed-off-by: gfanton <[email protected]>
Signed-off-by: gfanton <[email protected]>
Signed-off-by: gfanton <[email protected]>
Makefile
Outdated
@@ -45,3 +45,13 @@ fmt: | |||
.PHONY: lint | |||
lint: | |||
$(rundep) github.com/golangci/golangci-lint/cmd/golangci-lint run --config .github/golangci.yml | |||
|
|||
.PHONY: imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we merge in make fmt
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.PHONY: tidy | ||
tidy: | ||
$(MAKE) --no-print-directory -C misc tidy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please double-check? I vaguely recall creating something similar, possibly only in the CI. Just ensure that there isn't already an existing solution for the same purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Description This PR fixes the `noop` log reference that was broken in #1574, after the #1302 PR was merged in earlier. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
## Description This PR introduces log standardization across the codebase, to utilize the `slog.Logger`. Since the gno repo currently utilizes `go1.20` as the minimum version, this PR utilizes the `golang.org/x/exp/log` package. Additionally, this PR removes log level management from the TM2 config, and instead moves it into the start command. Closes gnolang#999 Thank you @gfanton for helping out with zap and simplifying the API 🙏 Special shoutout to @moul's [zapconfig](https://github.com/moul/zapconfig/tree/master), for being an inspiration on zap setup. **BREAKING CHANGE**: - the `tm2/log` logger interface has been removed, everything has been swapped to `*slog.Logger` Example of different log levels: ![cast](https://github.com/gnolang/gno/assets/16712663/2288ad98-7f72-4f05-b749-827b815b7f16) <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details> --------- Signed-off-by: gfanton <[email protected]> Co-authored-by: gfanton <[email protected]> Co-authored-by: Manfred Touron <[email protected]>
## Description This PR fixes the `noop` log reference that was broken in gnolang#1574, after the gnolang#1302 PR was merged in earlier. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
Description
This PR introduces log standardization across the codebase, to utilize the
slog.Logger
.Since the gno repo currently utilizes
go1.20
as the minimum version, this PR utilizes thegolang.org/x/exp/log
package.Additionally, this PR removes log level management from the TM2 config, and instead moves it into the start command.
Closes #999
Thank you @gfanton for helping out with zap and simplifying the API 🙏
Special shoutout to @moul's zapconfig, for being an inspiration on zap setup.
BREAKING CHANGE:
tm2/log
logger interface has been removed, everything has been swapped to*slog.Logger
Example of different log levels:
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description