Closed simon04 closed 5 months ago
Hi @simon04, thank you for taking the time and opening the PR adding the Caddy log support. I'm not a Caddy user myself but I was wondering if the PR change could be done without adding the types? Is that required for it to work or could we do without the typings? It seems the most risky part of the change as no other format import uses that.
Hi @michalkleiner, the types are defined in https://peps.python.org/pep-0484/ and are being used more and more in the Python ecosystem. Sure, the code works w/o types as well, but we'd loose some static analysis capabilities.
Since the type classes are wrapped in typing.TYPE_CHECKING
, no harm should be done for production:
A special constant that is assumed to be True by 3rd party static type checkers. It is False at runtime. https://docs.python.org/3.12/library/typing.html#typing.TYPE_CHECKING
Please let me know how to proceed...
@sgiehl what's your opinion here? I'd accept the PR without the types, but if you're happy with it as is then all good with me.
@simon04 Yes. Please remove the typing for now. We can consider adding that at a later step for the whole script if useful.
Please also rebase your branch on the latest changes from 5.x-dev
, hopefully this will trigger the tests to run for this PR.
Hi @michalkleiner and @sgiehl, I've made the progress in static type checking undone. Feel free to merge now.
Thank you for the contribution, @simon04!
Description:
Add Caddy json log support, https://caddyserver.com/docs/caddyfile/directives/log
Review