tapir icon indicating copy to clipboard operation
tapir copied to clipboard

docs: add some example of custom ServerLog

Open kpodsiad opened this issue 2 years ago • 3 comments

Hey folks! First of all thanks for wonderful library.

I've created this PR because it wasn't obviously clear to me how to log decoding errors, I spent couple of hours playing with DefaultServerLog and wondering why nothing is being logged, then I had this "aha" moment when I understood what's going on.

I think scaladoc which I added about doLogAllDecodeFailures should be enough explanation for future users as I realize that changing behavior of DefaultSerLog might break somebodys workflow. Also, I provided an example how custom ServerLog can look like.

What do you think?

kpodsiad avatar Jan 18 '23 11:01 kpodsiad

Thanks! However, instead of adding a "Beware, do not use" comment, I think it's better to fix the underlying implementation. Do I understand correctly that the name logAllDecodeFailures is misleading? Maybe simple renaming this (and the do... method) to logNotHandledDecodeFailures would be sufficient?

adamw avatar Jan 19 '23 13:01 adamw

Maybe do not use is too strong ;) Use with caution sounds better, doesn't it?

I was thinking about renaming it, but will this be binary compatible change?

kpodsiad avatar Jan 19 '23 14:01 kpodsiad

It won't, but only core needs to hold bin-compat. server is still in "stabilising"

adamw avatar Jan 19 '23 15:01 adamw

Closing old PRs

adamw avatar Apr 03 '24 08:04 adamw