log to file pls

This commit is contained in:
Tomáš Mládek 2018-01-31 14:56:29 +01:00
parent 81a8dcca22
commit 45a4932d79

View file

@ -12,14 +12,15 @@ import youtube_dl
from telegram import MessageEntity from telegram import MessageEntity
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger("kunsax")
DIR = os.path.dirname(os.path.realpath(__file__)) DIR = os.path.dirname(os.path.realpath(__file__))
TMP_DIR = '/tmp' TMP_DIR = '/tmp'
OUT_DIR = DIR + '/out' OUT_DIR = DIR + '/out'
logging.basicConfig(filename=OUT_DIR + '/delojza.log',
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger("kunsax")
def ytdl_has(url): def ytdl_has(url):
ies = youtube_dl.extractor.gen_extractors() ies = youtube_dl.extractor.gen_extractors()