once <https://github.com/pantsbuild/pants/pull/107...
# development
h
once https://github.com/pantsbuild/pants/pull/10729 is merged, we'll have the ability to filter logs by target
cf. https://github.com/pantsbuild/pants/pull/10734#issuecomment-687325966 , it seems like we'll want to be able to start setting individual log messages with custom targets
👍 1
in rust I think we could've been doing this all along with the existing log macros, we just weren't previously
and in python I think we'll need a one-liner change in
logger.py
h
I definitely agree that we want this functionality in Python
h
actually I was mistake - we can already do this in python too
h
how so?
h
if we want a custom target, we can invoke
logger = logging.getLogger("some_name")
💯 1
and python logs logged with that logger with use that name as the target
logger = logging.getLogger(__name__)
is just a convention we use
👍 1
h
So you could have this in the same file:
Copy code
module_logger = logging.getLogger(__name__)
custom_logger = logging.getLogger("custom")
👍 1