Change "error" to "fatal" and fix styling for fatal

master
Arinerron 2018-01-27 20:43:54 -08:00
parent 64408fa12f
commit 0d423aaefd
No known key found for this signature in database
GPG Key ID: 99383627861C62F0
2 changed files with 4 additions and 4 deletions

View File

@ -195,4 +195,4 @@ def error(data):
# fatal: when the something so bad has happened that the prorgam must stop # fatal: when the something so bad has happened that the prorgam must stop
def fatal(data): def fatal(data):
if get_level() <= LEVEL_FATAL: if get_level() <= LEVEL_FATAL:
log('#', data, colors.bg.red + colors.fg.black) log('#', data, colors.bg.red + colors.fg.green + colors.bold)

View File

@ -61,7 +61,7 @@ HiddenServicePort 80 127.0.0.1:''' + str(self.hsPort) + '''
try: try:
tor = subprocess.Popen([torBinary, '-f', self.torConfigLocation], stdout=subprocess.PIPE, stderr=subprocess.PIPE) tor = subprocess.Popen([torBinary, '-f', self.torConfigLocation], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except FileNotFoundError: except FileNotFoundError:
logger.error("Tor was not found in your path or the Onionr directory. Install Tor and try again.") logger.fatal("Tor was not found in your path or the Onionr directory. Please install Tor and try again.")
sys.exit(1) sys.exit(1)
# wait for tor to get to 100% bootstrap # wait for tor to get to 100% bootstrap
for line in iter(tor.stdout.readline, b''): for line in iter(tor.stdout.readline, b''):
@ -70,7 +70,7 @@ HiddenServicePort 80 127.0.0.1:''' + str(self.hsPort) + '''
elif 'Opening Socks listener' in line.decode(): elif 'Opening Socks listener' in line.decode():
logger.debug(line.decode()) logger.debug(line.decode())
else: else:
logger.error('Failed to start Tor. Try killing any other Tor processes owned by this user.') logger.fatal('Failed to start Tor. Try killing any other Tor processes owned by this user.')
return False return False
logger.info('Finished starting Tor') logger.info('Finished starting Tor')
self.readyState = True self.readyState = True