Change "error" to "fatal" and fix styling for fatal
This commit is contained in:
parent
64408fa12f
commit
0d423aaefd
@ -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)
|
||||||
|
@ -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
|
||||||
@ -94,4 +94,4 @@ HiddenServicePort 80 127.0.0.1:''' + str(self.hsPort) + '''
|
|||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
os.kill(int(pidN), signal.SIGTERM)
|
os.kill(int(pidN), signal.SIGTERM)
|
||||||
os.remove('data/torPid.txt')
|
os.remove('data/torPid.txt')
|
||||||
|
Loading…
Reference in New Issue
Block a user