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
def fatal(data):
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:
tor = subprocess.Popen([torBinary, '-f', self.torConfigLocation], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
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)
# wait for tor to get to 100% bootstrap
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():
logger.debug(line.decode())
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
logger.info('Finished starting Tor')
self.readyState = True
@ -94,4 +94,4 @@ HiddenServicePort 80 127.0.0.1:''' + str(self.hsPort) + '''
except:
return
os.kill(int(pidN), signal.SIGTERM)
os.remove('data/torPid.txt')
os.remove('data/torPid.txt')