structlog support?

Could I see an example of how struct log would be implimented officially?
4 Replies
Hall
Hall2w ago
Someone will reply to you shortly. In the meantime, this might help:
provincial-silver
provincial-silver2w ago
Hey @Rykari Crawlee, uses a standard logger, you can plug in structlog by following its official documentation - https://www.structlog.org/en/stable/standard-library.html In the Crawlee documentation, there is an example of connecting loguru which you can use as an example - https://crawlee.dev/python/docs/examples/configure-json-logging
structlog
Standard Library Logging
Ideally, structlog should be able to be used as a drop-in replacement for standard library’s logging by wrapping it. In other words, you should be able to replace your call to logging.getLogger() b...
Сonfigure JSON logging | Crawlee for Python · Fast, reliable Pyth...
Crawlee helps you build and maintain your Python crawlers. It's open source and modern, with type hints for Python to help you catch bugs early.
helpful-purple
helpful-purpleOP2w ago
eh, that makes this kinda dirty for if I want to handle tracebacks though no? (since they use stderr?)
provincial-silver
provincial-silver2w ago
But stderr is also one of the standard outputs of a standard logger. I haven't used structlog, but given that it can wrap around the standard logger, I don't see any problems for that. Or any dirty tricks.

Did you find this page helpful?