summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-11-26 18:12:36 -0300
committerdrebs <drebs@leap.se>2016-12-12 09:17:51 -0200
commitfbca1644823acbe4165ad1087db5baed28a6809d (patch)
treeb70dc12bcb8a86221b62b3bab9ab6c817faefdd3 /scripts
parentd72e3763538d1156bcf72b643626c2111a5a02cf (diff)
[refactor] improve logging
Some exceptions were missing a proper description and client_side_db.py script wasn't capturing logs from Twisted.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/db_access/client_side_db.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/db_access/client_side_db.py b/scripts/db_access/client_side_db.py
index 2acee2b5..48eec0f7 100644
--- a/scripts/db_access/client_side_db.py
+++ b/scripts/db_access/client_side_db.py
@@ -1,13 +1,13 @@
#!/usr/bin/python
import os
+import sys
import argparse
import tempfile
import getpass
import requests
import srp._pysrp as srp
import binascii
-import logging
import json
import time
@@ -15,6 +15,7 @@ from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from leap.soledad.client import Soledad
+from leap.soledad.common.log import getLogger
from leap.keymanager import KeyManager
from leap.keymanager.openpgp import OpenPGPKey
@@ -39,9 +40,9 @@ Use the --help option to see available options.
# create a logger
-logger = logging.getLogger(__name__)
-LOG_FORMAT = '%(asctime)s %(message)s'
-logging.basicConfig(format=LOG_FORMAT, level=logging.DEBUG)
+logger = getLogger(__name__)
+from twisted.python import log
+log.startLogging(sys.stdout)
safe_unhexlify = lambda x: binascii.unhexlify(x) if (