Added Logger class; refactored logging accordingly

This commit is contained in:
Salvatore Ingala
2019-10-08 19:08:12 +07:00
parent 7f9c7d8609
commit bae9b6b913
11 changed files with 109 additions and 82 deletions

View File

@@ -1,10 +1,11 @@
from sys import argv
from getopt import getopt
from pisa import logging, M
from pisa import logging, Logger
from pisa.api import start_api
from pisa.tools import can_connect_to_bitcoind, in_correct_network
logger = Logger("Pisad")
if __name__ == '__main__':
debug = False
@@ -19,8 +20,8 @@ if __name__ == '__main__':
start_api()
else:
logging.error(M("[Pisad] bitcoind is running on a different network, check conf.py and bitcoin.conf. "
"Shutting down"))
logger.error("[Pisad] bitcoind is running on a different network, check conf.py and bitcoin.conf. "
"Shutting down")
else:
logging.error(M("[Pisad] can't connect to bitcoind. Shutting down"))
logging.error("[Pisad] can't connect to bitcoind. Shutting down")