mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-30 14:49:28 +01:00
Actually implement 'nick', 'ident', and 'loglevel' config options
This commit is contained in:
parent
087a4e7e5c
commit
cfc840ebb3
12
log.py
12
log.py
@ -1,5 +1,15 @@
|
|||||||
import logging
|
import logging
|
||||||
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s [%(levelname)s] %(message)s')
|
import sys
|
||||||
|
from conf import conf
|
||||||
|
|
||||||
|
level = conf['bot']['loglevel'].upper()
|
||||||
|
try:
|
||||||
|
level = getattr(logging, level)
|
||||||
|
except AttributeError:
|
||||||
|
print('ERROR: Invalid log level %r specified in config.' % level)
|
||||||
|
sys.exit(3)
|
||||||
|
|
||||||
|
logging.basicConfig(level=level, format='%(asctime)s [%(levelname)s] %(message)s')
|
||||||
|
|
||||||
global log
|
global log
|
||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
|
@ -142,7 +142,9 @@ def connect(irc):
|
|||||||
f('SERVER {host} {Pass} 0 {sid} :PyLink Service'.format(host=host,
|
f('SERVER {host} {Pass} 0 {sid} :PyLink Service'.format(host=host,
|
||||||
Pass=irc.serverdata["sendpass"], sid=irc.sid))
|
Pass=irc.serverdata["sendpass"], sid=irc.sid))
|
||||||
f(':%s BURST %s' % (irc.sid, ts))
|
f(':%s BURST %s' % (irc.sid, ts))
|
||||||
irc.pseudoclient = spawnClient(irc, 'PyLink', 'pylink', host, modes=set([("+o", None)]))
|
nick = conf['bot'].get('nick') or 'PyLink'
|
||||||
|
ident = conf['bot'].get('ident') or 'pylink'
|
||||||
|
irc.pseudoclient = spawnClient(irc, nick, ident, host, modes={("+o", None)})
|
||||||
f(':%s ENDBURST' % (irc.sid))
|
f(':%s ENDBURST' % (irc.sid))
|
||||||
for chan in irc.serverdata['channels']:
|
for chan in irc.serverdata['channels']:
|
||||||
joinClient(irc, irc.pseudoclient.uid, chan)
|
joinClient(irc, irc.pseudoclient.uid, chan)
|
||||||
|
Loading…
Reference in New Issue
Block a user