Pass logger to fasthttp#98

Merged
6543 merged 3 commits from :add-fasthttp-logger into main 2022-07-12 15:32:48 +02:00
Owner
  • Use a logger with FASTHTTP prefix as fasthttp's logger so it's easy to see what fasthttp is logging in console/journal.
- Use a logger with `FASTHTTP` prefix as fasthttp's logger so it's easy to see what fasthttp is logging in console/journal.
Pass logger to fasthttp
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
4789d2e869
- Use a logger with `FASTHTTP` prefix as fasthttp's logger so it's easy to see what fasthttp is logging in console/journal.
@ -14,0 +16,4 @@
type fasthttpLogger struct{}
func (fasthttpLogger) Printf(format string, args ...interface{}) {
log.Printf("[FASTHTTP] "+format, args...)
Contributor

I think we should use something like
log.Str("fasthttp").Printf(...)
as zerolog is a structural logger

I think we should use something like `log.Str("fasthttp").Printf(...)` as zerolog is a structural logger
Author
Owner

Could you point to the function of zerolog? I don't see it has an exported function called log.Str(...)

Could you point to the function of zerolog? I don't see it has an exported function called `log.Str(...)`
Contributor

I'll have a look into it

I'll have a look into it
Contributor
- log.Printf("[FASTHTTP] "+format, args...) + log.Info().Bool("fasthttp", true).Msgf(format, args...) 

that would be more the zerolog way ... through I dont know if we sould use Debug or Info or Trace

```diff - log.Printf("[FASTHTTP] "+format, args...) + log.Info().Bool("fasthttp", true).Msgf(format, args...) ``` that would be more the zerolog way ... through I dont know if we sould use Debug or Info or Trace
Author
Owner

I guess for now info, fasthttp isn't clear on the usage of logger(currently it's just printing errors)

I guess for now info, fasthttp isn't clear on the usage of logger(currently it's just printing errors)
Author
Owner

I don't think this is correct, https://go.dev/play/p/dx3bHPMsAXD

It's printing the raw info:

{"level":"info","fasthttp":true,"time":"2009-11-10T23:00:00Z","message":"Hi o/"} 
I don't think this is correct, https://go.dev/play/p/dx3bHPMsAXD It's printing the raw info: ``` {"level":"info","fasthttp":true,"time":"2009-11-10T23:00:00Z","message":"Hi o/"} ```
Contributor

well yes as we did not specify a format ...

well yes as we did not specify a format ...
Merge branch 'main' into add-fasthttp-logger
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
c29d12374f
Merge branch 'main' into add-fasthttp-logger
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ca66739389
6543 approved these changes 2022-07-12 15:31:14 +02:00
6543 left a comment
Contributor

well better having logs than none ... I'm still not hapy as is

well better having logs than none ... I'm still not hapy as is
6543 merged commit fd24b4a2bc into main 2022-07-12 15:32:48 +02:00
6543 referenced this pull request from a commit 2022-07-12 15:32:48 +02:00
6543 added this to the v4.0 milestone 2022-07-15 17:16:58 +02:00
6543 modified the milestone from v4.0 to v3.1 2022-07-15 21:02:12 +02:00
Sign in to join this conversation.
No description provided.