Going to use the logging module for logging
This commit is contained in:
parent
bca9c19053
commit
96837ff774
1 changed files with 5 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
'''WizardKit: Standard Functions'''
|
'''WizardKit: Standard Functions'''
|
||||||
# vim: sts=2 sw=2 ts=2
|
# vim: sts=2 sw=2 ts=2
|
||||||
|
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
@ -22,6 +23,7 @@ COLORS = {
|
||||||
'PURPLE': '\033[35m',
|
'PURPLE': '\033[35m',
|
||||||
'CYAN': '\033[36m',
|
'CYAN': '\033[36m',
|
||||||
}
|
}
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
|
@ -38,9 +40,11 @@ def input_text(prompt='Enter text'):
|
||||||
tcflush(sys.stdin, TCIOFLUSH)
|
tcflush(sys.stdin, TCIOFLUSH)
|
||||||
try:
|
try:
|
||||||
response = input(prompt)
|
response = input(prompt)
|
||||||
|
LOG.debug('%s.input_text response: %s', __name__, response)
|
||||||
except EOFError:
|
except EOFError:
|
||||||
# Ignore and try again
|
# Ignore and try again
|
||||||
print('')
|
LOG.warning('Exception occured', exc_info=True)
|
||||||
|
print('', flush=True)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue