-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_up_repl.py
More file actions
31 lines (24 loc) · 938 Bytes
/
test_up_repl.py
File metadata and controls
31 lines (24 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#use this to have repl initialize
#use anaconda ipython
import configparser, time
import logging
import logging.handlers
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.ERROR)
logging.getLogger().setLevel(level=logging.ERROR)
logger = logging.getLogger('clone')
fh = logging.handlers.RotatingFileHandler("logs/bot.log", maxBytes=100000, backupCount=5, encoding='utf-8')
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
formatter.converter = time.gmtime
fh.setFormatter(formatter)
logger.addHandler(fh)
# create console handler with a higher log level
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
from celebro import Celebro
config = configparser.ConfigParser()
config.read('config.ini')
logger.setLevel(config.getint('DEFAULT','LOG_LEVEL'))
celebro_instance = Celebro(config)