本文整理匯總了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