pyatv icon indicating copy to clipboard operation
pyatv copied to clipboard

Replace global loggers with contextual ones everywhere

Open postlund opened this issue 4 years ago • 0 comments

What feature would you like? Currently, everything is logged using _LOGGER in each file (which corresponds to the current module). This however becomes confusing when having multiple connections active at the same time as you can't know which connection a log point belongs to. In some places, like in MRP, I have made some hacks to add IP addresses and port numbers, but that is what I said a hack.

Describe the solution you'd like I would prefer to use a logging adapter like I did in localtuya:

https://github.com/rospogrigio/localtuya/blob/363d76372c074a35e97fc66be289ba8c807092df/custom_components/localtuya/pytuya/init.py#L102

Any other information to share? No

postlund avatar Jun 13 '21 10:06 postlund