本文整理汇总了Python中dtella.common.log.LOG.debug方法的典型用法代码示例。如果您正苦于以下问题:Python LOG.debug方法的具体用法?Python LOG.debug怎么用?Python LOG.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtella.common.log.LOG
的用法示例。
在下文中一共展示了LOG.debug方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkIncomingNick
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def checkIncomingNick(self, n):
# Validate new nicks as they join.
# If successful, return inick, else raise NickError.
try:
inick = dc_to_irc(n.nick)
if inick.lower() == self.bot_user.inick.lower():
raise NickError("Nick '%s' conflicts with IRC bot." % inick)
for q, reason in self.qlines.itervalues():
if q.match(inick):
raise NickError(
"Nick '%s' is Q-lined: %s" % (inick, reason))
except NickError, e:
LOG.debug("Bad nick: %s %s" % (n.nick, str(e)))
# Bad nick. KICK!
osm = self.main.osm
chunks = []
osm.bsm.addKickChunk(
chunks, n, cfg.irc_to_dc_bot, str(e),
rejoin=False, silent=True)
osm.bsm.sendBridgeChange(chunks)
raise
示例2: runDconfigPusher
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def runDconfigPusher():
import dtella.bridge_config as cfg
setLogFile(cfg.file_base + ".log", 4<<20, 4)
LOG.debug("Dconfig Pusher Logging Manager Initialized")
addTwistedErrorCatcher(LOG.critical)
from dtella.bridge.push_dconfig_main import DtellaMain_DconfigPusher
dtMain = DtellaMain_DconfigPusher()
reactor.run()
示例3: runClient
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def runClient(dc_port):
#Logging for Dtella Client
setLogFile("dtella.log", 1<<20, 1)
LOG.debug("Client Logging Manager Initialized")
from dtella.client.main import DtellaMain_Client
dtMain = DtellaMain_Client()
import dtella.local_config as local
from dtella.common.util import get_version_string
def botErrorReporter(text):
dch = dtMain.dch
if dch:
dch.bot.say(
"Something bad happened. You might want to email this to "
"[email protected] so we'll know about it:\n"
"Version: %s %s\n%s" %
(local.hub_name, get_version_string()[3:], text))
addTwistedErrorCatcher(botErrorReporter)
addTwistedErrorCatcher(LOG.critical)
from dtella.client.dc import DCFactory
dfactory = DCFactory(dtMain, dc_port)
LOG.info("%s %s" % (local.hub_name, local.version))
def cb(first):
try:
reactor.listenTCP(dc_port, dfactory, interface='127.0.0.1')
except twisted.internet.error.CannotListenError:
if first:
LOG.warning("TCP bind failed. Killing old process...")
if terminate(dc_port):
LOG.info("Ok. Sleeping...")
reactor.callLater(2.0, cb, False)
else:
LOG.error("Kill failed. Giving up.")
reactor.stop()
else:
LOG.error("Bind failed again. Giving up.")
reactor.stop()
else:
LOG.info("Listening on 127.0.0.1:%d" % dc_port)
dtMain.startConnecting()
reactor.callWhenRunning(cb, True)
reactor.run()
示例4: runBridge
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def runBridge():
import dtella.bridge_config as cfg
setLogFile(cfg.file_base + ".log", 4<<20, 4)
LOG.debug("Bridge Logging Manager Initialized")
addTwistedErrorCatcher(LOG.critical)
from dtella.bridge.main import DtellaMain_Bridge
dtMain = DtellaMain_Bridge()
from dtella.bridge.bridge_server import getServiceConfig
scfg = getServiceConfig()
scfg.startService(dtMain)
reactor.run()
示例5: signPacket
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def signPacket(self, packet, broadcast):
data = ''.join(packet)
if broadcast:
body = data[0:2] + data[10:]
else:
body = data
data_hash = md5(body).digest()
t = time.time()
sig, = self.rsa_obj.sign(data_hash, None)
LOG.debug("Sign Time = %f sec" % (time.time() - t))
packet.append(long_to_bytes(sig))
示例6: setChannelBan
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def setChannelBan(self, whoset, on_off, banmask):
if on_off:
self.chanbans[banmask] = wild_to_regex(banmask)
action = "added"
else:
self.chanbans.pop(banmask, None)
action = "removed"
LOG.debug( "bans= %s" % self.chanbans.keys() )
try:
osm = self.getOnlineStateManager()
except NotOnline:
return
chunks = []
osm.bsm.addChatChunk(
chunks, cfg.irc_to_dc_bot,
"%s %s ban: %s" % (irc_to_dc(whoset), action, banmask))
osm.bsm.sendBridgeChange(chunks)
示例7: addDCHandler
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def addDCHandler(self, dch):
CHECK(not self.dch)
CHECK(dch.state == 'ready')
self.dch = dch
# Cancel the disconnect timeout
dcall_discard(self, 'disconnect_dcall')
# Start connecting, or get status of current connection
text = self.startConnecting()
if text:
# We must already be connecting/online.
# Show the last status message.
LOG.debug(text)
dch.pushStatus(text)
# Send a message if there's a newer version
self.dcfg.resetReportedVersion()
self.dcfg.reportNewVersion()
self.stateChange_ObserverUp()
示例8: showLoginStatus
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def showLoginStatus(self, text, counter=None):
# counter can be:
# - int: set the counter to this value
# - 'inc': increment from the previous counter value
# - None: don't show a counter
if type(counter) is int:
self.login_counter = counter
elif counter == 'inc':
self.login_counter += 1
if counter is not None:
# Prepend a number
text = "%d. %s" % (self.login_counter, text)
# Remember this for new DC clients
self.login_text = text
LOG.debug(text)
dch = self.dch
if dch:
dch.pushStatus(text)
示例9: advanceQueue
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def advanceQueue(self):
# Only continue if we have a queue, and spare capacity
if not (self.dnsq and self.limiter > 0):
return
self.limiter -= 1
ip, ent = self.dnsq.popleft()
def cb(hostname):
for ipp in ent.waiting_ipps:
self.signOn(ipp, hostname)
ent.waiting_ipps.clear()
if hostname is None:
del self.cache[ip]
else:
ent.hostname = hostname
self.limiter += 1
self.advanceQueue()
LOG.debug("Querying %s" % Ad().setRawIP(ip).getTextIP())
ipToHostname(Ad().setRawIP(ip)).addCallback(cb)
示例10: updateSuccess
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def updateSuccess(self, result):
self.busy = False
LOG.debug("Dconfig Update Successful: %s" % result)
self.scheduleUpdate(cfg.dconfig_push_interval)
示例11: fail_cb
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def fail_cb(detail):
LOG.debug("bC failed: %s" % detail)
示例12: showSystemMessage
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import debug [as 别名]
def showSystemMessage(self, text):
LOG.debug(text)
dch = self.dch
if dch:
dch.bot.say(text)