mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-01-18 23:37:05 +00:00
Logging improvementµ
This commit is contained in:
parent
2bccf99f7c
commit
29629e2785
7
twoot.py
7
twoot.py
|
@ -235,7 +235,7 @@ def login(instance, account, password):
|
||||||
logging.fatal('ERROR: Login to ' + instance + ' Failed\n')
|
logging.fatal('ERROR: Login to ' + instance + ' Failed\n')
|
||||||
logging.fatal(me)
|
logging.fatal(me)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
return mastodon
|
return mastodon
|
||||||
|
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ def main(argv):
|
||||||
|
|
||||||
# Setup logging to file
|
# Setup logging to file
|
||||||
# TODO Add timestamps
|
# TODO Add timestamps
|
||||||
logging.basicConfig(filename=twit_account + '.log', level=logging.WARNING)
|
logging.basicConfig(filename=twit_account + '.log', level=logging.INFO)
|
||||||
logging.info('Running with the following parameters:')
|
logging.info('Running with the following parameters:')
|
||||||
logging.info(' -t ' + twit_account)
|
logging.info(' -t ' + twit_account)
|
||||||
logging.info(' -i ' + mast_instance)
|
logging.info(' -i ' + mast_instance)
|
||||||
|
@ -285,6 +285,7 @@ def main(argv):
|
||||||
logging.info(' -v ' + str(get_vids))
|
logging.info(' -v ' + str(get_vids))
|
||||||
logging.info(' -a ' + str(max_age))
|
logging.info(' -a ' + str(max_age))
|
||||||
logging.info(' -d ' + str(min_delay))
|
logging.info(' -d ' + str(min_delay))
|
||||||
|
logging.info(' -c ' + str(cap))
|
||||||
|
|
||||||
# Try to open database. If it does not exist, create it
|
# Try to open database. If it does not exist, create it
|
||||||
sql = sqlite3.connect('twoot.db')
|
sql = sqlite3.connect('twoot.db')
|
||||||
|
@ -326,7 +327,7 @@ def main(argv):
|
||||||
|
|
||||||
# Verify that download worked
|
# Verify that download worked
|
||||||
if twit_account_page.status_code != 200:
|
if twit_account_page.status_code != 200:
|
||||||
logging.fatal('The Nitter page did not download correctly from' + url + '. Aborting')
|
logging.fatal('The Nitter page did not download correctly from ' + url + '. Aborting')
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
logging.info('Nitter page downloaded successfully')
|
logging.info('Nitter page downloaded successfully')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user