1
0
mirror of https://github.com/MrDetonia/Maki.git synced 2024-12-28 21:16:22 -05:00

Added logging, v0.12.0

This commit is contained in:
Zac Herd 2016-04-19 15:14:11 +01:00
parent e833078d06
commit 24498b5f1d
2 changed files with 10 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
secret.py
__pycache__
*.json
*.log

10
bot.py
View File

@ -13,6 +13,8 @@ import time
import datetime
import random
import json
import logging
import markov
# file in this directory called "secret.py" should contain these variables
@ -25,7 +27,7 @@ from secret import email,pwd
name = "Maki"
# bot version
version = "v0.11.2"
version = "v0.12.0"
# text shown by .help command
helptext = """I am a bot written in Python by MrDetonia
@ -86,6 +88,12 @@ if os.path.isfile('tells.json'):
# this instance of the Discord client
client = discord.Client()
# logging setup
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)
# FUNCTIONS