pyo3-log icon indicating copy to clipboard operation
pyo3-log copied to clipboard

[Feature Request]: Use child instead of root logger (Python)

Open thewh1teagle opened this issue 1 year ago • 1 comments

Currently, pyo3 logs to the root logger. I suggest using a named child logger (by convention name i.e. rookiepy), so downstream applications can control its logging independently from other loggers in the application.

https://github.com/thewh1teagle/rookie/issues/82

thewh1teagle avatar Nov 06 '24 01:11 thewh1teagle

Actually, I believe it uses logger based on the target under which the Rust application logs, forming a hierarchy. Is it possible the application logs to an empty target name?

Or you basically want to move the whole hierarchy somewhere? If that is so, I think it would make sense to use some kind of wrapper to mangle the module names as you desire, there using some kind of composition instead of injecting such functionality in each and every one logging destination library.

Is it possible I understand your request incorrectly?

vorner avatar Nov 09 '24 09:11 vorner

He perhaps means that to use the logger in the example, you use logging.getLogger() instead of logging.getLogger('hello_world'). The latter works as well though.

benruijl avatar Sep 18 '25 09:09 benruijl

Is this solved by #70?

vorner avatar Oct 05 '25 11:10 vorner