logging: basics
This commit is contained in:
@@ -27,9 +27,14 @@ from electrum.transaction import Transaction
|
||||
from electrum.i18n import _
|
||||
from electrum.keystore import Hardware_KeyStore
|
||||
from ..hw_wallet import HW_PluginBase
|
||||
from electrum.util import print_error, to_string, UserCancelled, UserFacingException
|
||||
from electrum.util import to_string, UserCancelled, UserFacingException
|
||||
from electrum.base_wizard import ScriptTypeNotSupported, HWD_SETUP_NEW_WALLET
|
||||
from electrum.network import Network
|
||||
from electrum.logging import get_logger
|
||||
|
||||
|
||||
_logger = get_logger(__name__)
|
||||
|
||||
|
||||
try:
|
||||
import hid
|
||||
@@ -406,7 +411,7 @@ class DigitalBitbox_Client():
|
||||
r = to_string(r, 'utf8')
|
||||
reply = json.loads(r)
|
||||
except Exception as e:
|
||||
print_error('Exception caught ' + repr(e))
|
||||
_logger.info(f'Exception caught {repr(e)}')
|
||||
return reply
|
||||
|
||||
|
||||
@@ -431,7 +436,7 @@ class DigitalBitbox_Client():
|
||||
if 'error' in reply:
|
||||
self.password = None
|
||||
except Exception as e:
|
||||
print_error('Exception caught ' + repr(e))
|
||||
_logger.info(f'Exception caught {repr(e)}')
|
||||
return reply
|
||||
|
||||
|
||||
@@ -679,7 +684,7 @@ class DigitalBitbox_KeyStore(Hardware_KeyStore):
|
||||
except BaseException as e:
|
||||
self.give_error(e, True)
|
||||
else:
|
||||
print_error("Transaction is_complete", tx.is_complete())
|
||||
_logger.info("Transaction is_complete {tx.is_complete()}")
|
||||
tx.raw = tx.serialize()
|
||||
|
||||
|
||||
@@ -746,7 +751,7 @@ class DigitalBitboxPlugin(HW_PluginBase):
|
||||
)
|
||||
try:
|
||||
text = Network.send_http_on_proxy('post', url, body=args.encode('ascii'), headers={'content-type': 'application/x-www-form-urlencoded'})
|
||||
print_error('digitalbitbox reply from server', text)
|
||||
_logger.info(f'digitalbitbox reply from server {text}')
|
||||
except Exception as e:
|
||||
self.handler.show_error(repr(e)) # repr because str(Exception()) == ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user