Logging erreurs

This commit is contained in:
nyanloutre 2017-10-06 11:23:04 +02:00
parent 26996c04d2
commit 5fef0bddb6
Signed by: nyanloutre
GPG Key ID: F85D93686A3A9063
1 changed files with 6 additions and 0 deletions

6
run.py
View File

@ -1,6 +1,7 @@
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from telegram import ParseMode from telegram import ParseMode
from block_io import BlockIo, BlockIoAPIError from block_io import BlockIo, BlockIoAPIError
import logging
import os import os
BLOCK_IO_API_KEY = os.environ['BLOCK_IO_API_KEY'] BLOCK_IO_API_KEY = os.environ['BLOCK_IO_API_KEY']
@ -8,6 +9,11 @@ BLOCK_IO_PIN = os.environ['BLOCK_IO_PIN']
TELEGRAM_API_KEY = os.environ['TELEGRAM_API_KEY'] TELEGRAM_API_KEY = os.environ['TELEGRAM_API_KEY']
NETWORK = os.environ['NETWORK'] NETWORK = os.environ['NETWORK']
# Logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# Exceptions # Exceptions
class NoAccountError(Exception): class NoAccountError(Exception):