Closed m-Peter closed 1 month ago
[!CAUTION]
Review failed
The pull request is closed.
The recent updates enhance the NewHTTPServer
function and the Write
method of the responseHandler
struct in api/server.go
. These modifications improve parameter formatting for readability and refine logging behavior. The logging now captures only successful responses, reducing unnecessary clutter in logs. Overall, these changes aim to improve code clarity and streamline logging practices for better monitoring of API interactions.
Files | Change Summary |
---|---|
api/server.go |
Reformatted parameters in NewHTTPServer for readability; added Level to slogzerolog.Option ; refined Write method to log only successful responses. |
sequenceDiagram
participant Client
participant HTTPServer
participant ResponseHandler
Client->>HTTPServer: Send API Request
HTTPServer->>ResponseHandler: Handle Request
ResponseHandler->>HTTPServer: Create Response
alt Success
ResponseHandler->>HTTPServer: Log Successful Response
end
HTTPServer-->>Client: Return Response
🐇 In the code, I hop with glee,
Logging success, as it should be!
No more clutter, just the best,
Clear and bright, a bunny's quest!
With each change, we leap and bound,
A joyful code, where peace is found! 🐾
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
The way we previously set-up the geth log, for catching method handler crashes, resulted in logs with
warn
logging level as well, as can be seen below:It's the lines that have
WRN
level, and thereqid
field.We also avoid logging debug lines for API responses which have errored out, hence they do not have a result anyway:
For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes
Refactor