[Proposal] Add the log level to the error builder
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 990
- Forks
- 45
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 5
Description
What about adding a .Level(slog.Level) method to the error builder?
Pros:
- When I build an error in a nested function, the caller cannot differentiate between an acceptable error (warning?) and a blocking error (error).
- An HTTP status 404 is a warning while a 500 is an error, but both are considered errors by the HTTP frameworks.
Cons:
- The log level is a logger thing, while this library provides an error builder. The separation of concern is not fully respected.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the error builder API and the proposal for a .Level(slog.Level) method. Resolve whether log-level state belongs in this library or the logger, and define the expected behavior for warning-like 404 errors versus blocking 500 errors before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100