Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 0b96f10c

Přidáno uživatelem Pultak před více než 2 roky(ů)

re #9360 Added logging system -> log config, logging messages

Zobrazit rozdíly:

client/usb_detector/usb_reader.py
1
import logging
2

  
1 3
import usb.core
2 4
import usb.util
3 5

  
4 6

  
5 7
def read_connected_devices():
8
    logging.debug(f'reading all currently connected devices')
6 9
    detected_devices = []
7 10

  
8 11
    busses = usb.busses()
......
16 19
                serial_number = usb.util.get_string(device_info, device_info.iSerialNumber)
17 20
            except:
18 21
                # Failed to retrieve information from device
22
                logging.info(f"device idVendor:{dev.idVendor} idProduct:{dev.idProduct} has invalid format")
19 23
                pass
20 24

  
21 25
            if serial_number is not None:

Také k dispozici: Unified diff