Add debug config value.

pull/15/head
Andrew Williams 2014-11-15 20:31:36 +00:00
parent 9e41cf38af
commit 2e25d88031
1 changed files with 5 additions and 1 deletions

View File

@ -377,7 +377,11 @@ def DoSyncAndGetUpdated(items_to_sync, sync_state):
def main():
logging.basicConfig(level=logging.INFO)
if os.environ.get('TODOIST_DEBUG', None):
log_level = logging.DEBUG
else:
log_level = logging.INFO
logging.basicConfig(level=log_level)
if not API_TOKEN:
logging.error('No API key set, exiting...')
sys.exit(1)