log to file pls

This commit is contained in:
Tomáš Mládek 2018-01-31 14:56:29 +01:00 committed by Tomáš Mládek
parent 47eebac4d8
commit 5cef333c4a

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()