tocoteron / joycon-python

driver for Joy-Con (Nintendo Switch)
Other
114 stars 27 forks source link

Introduce logging to enable detailed debugging #8

Open atsukoba opened 4 years ago

atsukoba commented 4 years ago

By introducing logging, facilitate debugging when using as a module. Adding the argument of verbosity to each function produced by this module, users will be able to check errors occurred in internal modules such as hidapi

for example,

from pyjoycon import device
from pyjoycon.joycon import JoyCon

ids = device.get_ids("R", verbose=True)
joycon = JoyCon(*ids, verbose=True)
joycon.get_status(verbose=True)
tocoteron commented 4 years ago

It's nice idea. We will implement this option.

pbsds commented 3 years ago

The more pythonic solution would most likely be using logging:

import logging
logging.getLogger("pyjoycon").setLevel(logging.DEBUG)