How to disable logging
when parsing output?
#30
-
I have trouble with try:
shutil.which('ddcutil')
except Exception:
logging.exception('Error code RSJQ4A: the ddcutils binary is unavailable.')
ddcutil_available = False
logging.getLogger().debug('1 ddcutil_available = False')
else:
ddcutil_available = True
logging.getLogger().debug('2 ddcutil_available = True')
try:
sbc.list_monitors(method='ddcutil') == sbc.list_monitors()
except Exception:
# try:
# sbc.list_monitors() == int(input('As an integer, state how many monitors are available: '))
# except Exception:
# logging.exception('Error code RSJPK5: unable to acquire the list of monitors. Exiting the application.')
# raise SystemExit(1) from Exception
logging.exception('Error code RSJPK5: ddcutils is unable to acquire the list of monitors. Operations may become slow.')
ddcutil_available = False
logging.getLogger().debug('3 ddcutil_available = False')
else:
logging.getLogger().debug('ddcutil is available.')
ddcutil_available = True
logging.getLogger().debug('4 ddcutil_available = True') However, the undermentioned:
...and the undermentioned:
...both print I've tried the undermentioned:
...and the undermentioned: logging.basicConfig(level=logging.NOTSET) ...to no avail. Consequently, any tips? In fact, is this behaviour (log output by default) even intended, or have I screwed-up something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
Don't set the undermentioned:
...per the undermentioned: