[RFC] Generic Logger names in Python

Hello,

my first RFC, in life, so be patient. When I run command find python -type f -name "*.py" | xargs grep getLogger I can see, that names of Loggers are manually provided, e.g. Ethos-U, RPCTracker or auto_scheduler. As I can read in python logging tutorial better name is __name__ variable. It doesn’t require maintain names and is more generic to use filters, then example logger names would be tvm.relay.backend.contrib.ethosu.vela_api, tvm.rpc.tracker and tvm.auto_scheduler.search_task respectively.

I think it is easy to implement, and doesn’t introduce functionality changes. Places to check when configure logging, because many names will change.

1 Like

Thanks @pfk123! Personally I don’t know the specific reason that we didn’t do

logger = getLogger(__name__)

previously in the TVM codebase, and would love to hear from fellow developers. If there is no specific reason, I’m supportive for making this change

I support getLogger(__name__)!

Thanks @pfk123 for the PR!

@areusch Do you think we should send a formal RFC to TVM-RFC repo? I suppose so, but was wondering what we could do to accelerate this process for short and non-controversial ones like this

In this particular case I think it might be fine to skip given it is short and non-controversial, but good to leave it open for a bit

Yeah this one seems perhaps not worthy of a full RFC–it’s just a bunch of renames, and there isn’t a departure from policy. I was considering approving the PR immediately this morning but I think it would be good to allow another day or two in case someone has a legitimate concern.

i wish we had a comprehensive TVM logging guide, then we could just update that as a form of announcement of this cleanup (I think this thread otherwise is fine as a notification).

1 Like

Yeah I agree. Sorry I rushed a bit quicker, but let’s leave it open for a week or two in case there is any concern :slight_smile:

100% agree! The current logging system is a bit unsatisfactory in terms of clarity :frowning:

Just for record keeping, can we do a really short one, like 1 sentence or 2?

I’d almost prefer to put any such effort into just documenting logging, even if it’s just the Python part first. This isn’t anything elaborate–it’s just “use the standard Python logging as it normally is, with __name__ as the Logger name.”

Haha that makes sense to me.