本文整理汇总了Python中logger.logger.debug方法的典型用法代码示例。如果您正苦于以下问题:Python logger.debug方法的具体用法?Python logger.debug怎么用?Python logger.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger.logger
的用法示例。
在下文中一共展示了logger.debug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: connection
# 需要导入模块: from logger import logger [as 别名]
# 或者: from logger.logger import debug [as 别名]
def connection(self, user_name=None, password=None, private_key=None):
"""
connection target host by ssh protocal
:param user_name:
:param password:
:param private_key:
:return:
"""
hosts = set()
map(lambda _host: hosts.add(parse_host_port(_host[0])[0]), self.config["ps_hosts"])
map(lambda _host: hosts.add(parse_host_port(_host[0])[0]), self.config["worker_hosts"])
_ssh_clients = {}
for host in hosts:
logger.debug("ssh connect to host[%s]" % host)
_ssh_clients[host] = SSHConnection(host,
username=user_name,
password=password,
private_key=private_key)
return _ssh_clients
示例2: send_weibo
# 需要导入模块: from logger import logger [as 别名]
# 或者: from logger.logger import debug [as 别名]
def send_weibo(self, weibo):
if not isinstance(weibo, WeiboMessage):
raise ValueError( 'weibo must WeiboMessage class type' )
logger.debug( 'weibo must WeiboMessage class type' )
if weibo.is_empty:
return
pids = ''
if weibo.has_image:
pids = self.upload_images(images)
data = weibo.get_send_data(pids)
self.session.headers["Referer"] = self.Referer
try:
resp = self.session.post(
"http://www.weibo.com/aj/mblog/add?ajwvr=6&__rnd=%d" % int( time.time() * 1000),
data=data
)
logger.info('??[%s]????' % str(weibo))
except Exception as e:
logger.debug(e)
logger.info( '??[%s]????' % str(weibo) )
示例3: make_request
# 需要导入模块: from logger import logger [as 别名]
# 或者: from logger.logger import debug [as 别名]
def make_request(url):
import urllib2
if url:
url = url.encode('utf-8')
logger.debug(url)
try:
f = urllib2.urlopen(url)
read = f.read()
return read
except Exception as er:
logger.warning(er)
raise TimeoutException()
return False