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


Python Util.get_logger方法代码示例

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


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

示例1: _initialize_members

# 需要导入模块: from utils import Util [as 别名]
# 或者: from utils.Util import get_logger [as 别名]
    def _initialize_members(self,date,limit,logger):
        
        # get logger if exists. if not, create new instance.
        self._logger = logging.getLogger('OA.Flow') if logger else Util.get_logger('OA.Flow',create_file=False)

        # initialize required parameters.
        self._scrtip_path = os.path.dirname(os.path.abspath(__file__))
        self._date = date
        self._table_name = "flow"
        self._flow_results = []
        self._limit = limit
        self._data_path = None
        self._ipynb_path = None
        self._ingest_summary_path = None
        self._flow_scores = []
        self._results_delimiter = '\t'

        # get app configuration.
        self._oni_conf = Util.get_oni_conf()  

        # get scores fields conf
        conf_file = "{0}/flow_conf.json".format(self._scrtip_path)
        self._conf = json.loads(open (conf_file).read(),object_pairs_hook=OrderedDict)     
 
        # initialize data engine
        self._db = self._oni_conf.get('conf','DBNAME').replace("'","").replace('"','') 
        self._engine = Data(self._db, self._table_name,self._logger)
开发者ID:Open-Network-Insight,项目名称:oni-oa,代码行数:29,代码来源:flow_oa.py

示例2: __init__

# 需要导入模块: from utils import Util [as 别名]
# 或者: from utils.Util import get_logger [as 别名]
    def __init__(self,conf,logger=None):

        # get logger if exists. if not, create new instance.
        self._logger = logging.getLogger('OA.GTI')  if logger else Util.get_logger('OA.GTI',create_file=False)       
        self._gti_rest_client_path = conf['refclient']        
        self._gti_ci = conf['ci']
        self._gti_password = conf['password']
        self._gti_user = conf['user']
        self._gti_server = conf['server']        
        self._category_file = conf["category_file"]
        self._category_dict = {}
        self._load_category_dicts()
开发者ID:cgiraldo,项目名称:incubator-spot,代码行数:14,代码来源:gti.py

示例3: start_oa

# 需要导入模块: from utils import Util [as 别名]
# 或者: from utils.Util import get_logger [as 别名]
def start_oa(args):

    # setup the main logger for all the OA process.
    logger = Util.get_logger('OA',create_file=False)

    logger.info("-------------------- STARTING OA ---------------------")
    validate_parameters_values(args,logger)

    # create data type instance.
    module = __import__("{0}.{0}_oa".format(args.type),fromlist=['OA'])

    # start OA.
    oa_process = module.OA(args.date,args.limit,logger)
    oa_process.start()
开发者ID:cgiraldo,项目名称:incubator-spot,代码行数:16,代码来源:start_oa.py

示例4: __init__

# 需要导入模块: from utils import Util [as 别名]
# 或者: from utils.Util import get_logger [as 别名]
    def __init__(self,config,logger=None):

        self._logger = logging.getLogger('OA.IANA')  if logger else Util.get_logger('OA.IANA',create_file=False)        
        if COL_CLASS in config:
            self._qclass_file_path = config[COL_CLASS]
        if COL_QTYPE in config:
            self._qtype_file_path = config[COL_QTYPE]
        if COL_RCODE in config:
            self._rcode_file_path = config[COL_RCODE]
        if COL_PRESP in config:
            self._http_rcode_file_path = config[COL_PRESP]

        self._qclass_dict = {}
        self._qtype_dict = {}
        self._rcode_dict = {} 
        self._http_rcode_dict = {}
        self._init_dicts()
开发者ID:cgiraldo,项目名称:incubator-spot,代码行数:19,代码来源:iana_transform.py

示例5: __init__

# 需要导入模块: from utils import Util [as 别名]
# 或者: from utils.Util import get_logger [as 别名]
    def __init__(self,db, pipeline,logger=None):

        # get logger if exists. if not, create new instance.
        self._logger = logging.getLogger('OA.DATA')  if logger else Util.get_logger('OA.DATA',create_file=False)       
        self._initialize_engine(db, pipeline)
开发者ID:Open-Network-Insight,项目名称:oni-oa,代码行数:7,代码来源:data.py

示例6: __init__

# 需要导入模块: from utils import Util [as 别名]
# 或者: from utils.Util import get_logger [as 别名]
    def __init__(self,file,logger=None):

        self._logger = logging.getLogger('OA.GEO') if logger else Util.get_logger('OA.GEO',create_file=False) 
        self._ip_localization_file = file
        self._ip_localization_ranges = self._get_low_ips_in_ranges()
开发者ID:Open-Network-Insight,项目名称:oni-oa,代码行数:7,代码来源:geoloc.py


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