当前位置: 首页>>代码示例>>Python>>正文


Python Logger.error方法代码示例

本文整理汇总了Python中Utils.Logger.error方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.error方法的具体用法?Python Logger.error怎么用?Python Logger.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils.Logger的用法示例。


在下文中一共展示了Logger.error方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _parse_douban

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import error [as 别名]
 def _parse_douban(page):
     soup = BeautifulSoup(page)
     ret = []
     try:
         table = soup.findAll('table', {'class':'olt'})[0]
         '''
         nexturl = soup.findAll('div', {'class':'paginator'})[0]\
             .findAll('span', {'class':'next'})[0]
         try:
             nexturl = nexturl.findAll('link')[0]['href']
         except:
             nexturl = ''
         '''
         for row in PageParser._clean(table)[1:]: #skip table header
             try:
                 url, _, _, reply_time = PageParser._clean(row)
             except:
                 continue
             url = PageParser._clean(url)[0]['href'].strip()
             reply_time = PageParser._clean(reply_time)[0].strip()
             if ':' in reply_time:
                 year = time.strftime('%Y-',time.localtime(time.time()))
                 reply_time = time.strptime(year+reply_time, '%Y-%m-%d %H:%M')
             else:
                 reply_time = time.strptime(reply_time, '%Y-%m-%d')
             reply_time = int(time.mktime(reply_time))
             hashurl = hashlib.md5(url).hexdigest()
             ret.append(Link(
                 hashurl=hashurl,
                 url=url,
                 reply_time=reply_time
             ))
     except IndexError:
         Logger.error('index error!')
     return ret #, nexturl
开发者ID:Freedom000,项目名称:zufang,代码行数:37,代码来源:PageParser.py

示例2: Logger

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import error [as 别名]
# Desc:    Functionality for sending email notifications to a set of email 
#          addresses in case of test suite success/failure, based on policies 
#          about the frequency and type of notifications desired.
#
#-------------------------------------------------------------------------------
from Utils import Logger
LOGGER = Logger(__name__).setup()

try:
    import sys
    import os
    import smtplib
    from email.mime.multipart import MIMEMultipart
    from email.mime.text import MIMEText
except ImportError, e:
    LOGGER.error(str(e))
    sys.exit(1)

class EmailNotifierException(Exception):
    '''
    General Exception raised by EmailNotifier.
    '''
    def __init__(self, desc):
        '''
        Constructs Exception
        @param desc: description of an error
        '''
        self.desc = desc
        
    def __str__(self):
        '''
开发者ID:xrootd,项目名称:xrootd-test-framework,代码行数:33,代码来源:EmailNotifier.py

示例3: Logger

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import error [as 别名]
# Desc:    TODO:
#-------------------------------------------------------------------------------
from Utils import Logger
LOGGER = Logger(__name__).setup()

try:
    import sys
    import os
    import socket
    import cherrypy
    
    from Utils import Command
    from Cheetah.Template import Template
    from cherrypy.lib.static import serve_file
except ImportError, e:
    LOGGER.error(str(e))
    sys.exit(1)

class XrdWebInterfaceException(Exception):
    '''
    General Exception raised by WebInterface.
    '''
    def __init__(self, desc):
        '''
        Constructs Exception
        @param desc: description of an error
        '''
        self.desc = desc
        
    def __str__(self):
        '''
开发者ID:jlsalmon,项目名称:xrootd-test-framework,代码行数:33,代码来源:WebInterface.py

示例4: __init__

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import error [as 别名]
try:
    import sys
    import os
    import re
    import threading
    import libvirt

    from ClusterUtils import ClusterManagerException, Cluster
    from ClusterUtils import ERR_CONNECTION, ERR_ADD_HOST, ERR_CREATE_NETWORK
    from Utils import Command, State
    from SocketUtils import XrdMessage
    from copy import deepcopy
    from libvirt import libvirtError
except ImportError, e:
    LOGGER.error(str(e))
    sys.exit(1)


class ClusterManager:
    """
    Virtual machines clusters' manager
    """

    def __init__(self):
        """
        Creates Manager instance. Needs url to virtual virt domains manager
        """
        # Socket reference back to the master, for publishing status updates
        self.sockStream = None
        # definitions of clusters. Key: name Value: cluster definition
开发者ID:jlsalmon,项目名称:xrootd-test-framework,代码行数:32,代码来源:ClusterManager.py


注:本文中的Utils.Logger.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。