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


Python logger.LOGGER类代码示例

本文整理汇总了Python中logger.LOGGER的典型用法代码示例。如果您正苦于以下问题:Python LOGGER类的具体用法?Python LOGGER怎么用?Python LOGGER使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: end_suite

 def end_suite(self, suite):
     LOGGER.end_suite(suite)
     if self._xmllogger.ended_output:
         LOGGER.output_file('Output', self._xmllogger.ended_output)
         orig_outpath = self._settings['Output']
         suite.context.output_file_changed(orig_outpath)
         self._create_split_log(self._xmllogger.ended_output, suite)
开发者ID:superbaby11,项目名称:autoOMC,代码行数:7,代码来源:output.py

示例2: log_request

def log_request(record):
    global hpclient
    req = json.dumps(record)
    LOGGER.info(req)

    if hpclient and (record['is_shellshock'] or app.config['hpfeeds.only_exploits'].lower() == 'false'):
        hpclient.publish(app.config['hpfeeds.channel'], req)
开发者ID:adityashrm21,项目名称:shockpot,代码行数:7,代码来源:shockpot.py

示例3: log_request

def log_request(record):
    global hpclient
    req = json.dumps(record)
    LOGGER.info(req)

    if hpclient and record['is_shellshock']:
        hpclient.publish(app.config['hpfeeds.channel'], req)
开发者ID:PSJoshi,项目名称:shockpot,代码行数:7,代码来源:shockpot.py

示例4: checkTrame

    def checkTrame(self):
        if self.trameUsed:
            LOGGER.debug("Trame received : {}".format(self.trameUsed.lessRawView()))
            if ("A55A" not in self.trameUsed.sep):
                LOGGER.warn("Wrong separator, rejected")

            if (self.doChecksum(self.trameUsed) not in self.trameUsed.checkSum):     
                #Mauvais checkSum
                LOGGER.warn("Wrong checksum, expected : {}, rejected".format(self.doChecksum(self.trameUsed)))

            with self.lock:
                if (self.trameUsed.ident in self.identSet):
                    #Recuperer le capteur en bdd
                    sensorUsed = sensor.Sensor.objects(physic_id=self.trameUsed.ident)[0]
                    newData = '' #la nouvelle data a entrer en base, type dynamique
                    if (sensorUsed.__class__.__name__=="Switch"):
                        newData=sensorUsed.translateTrame(self.trameUsed)
                    elif (sensorUsed.__class__.__name__=="Temperature"):
                        newData = sensorUsed.translateTrame(self.trameUsed)

                    elif (sensorUsed.__class__.__name__=="Position"):
                        newData = sensorUsed.translateTrame(self.trameUsed)
                    else :
                        LOGGER.warn("Other Captor (not handle (YET !) )")
                    # Update de la trame au niveau de la base
                    if newData :
                        sensorUsed.update(newData)
                        LOGGER.info(" Sensor {} ||New data {}".format(sensorUsed.physic_id, sensorUsed.current_state))
            self.trameUsed=''
开发者ID:Minizza,项目名称:ghome,代码行数:29,代码来源:traductor.py

示例5: rename

    def rename(self, path, path1):
        # Rename is handled by copying and deleting files...
        LOGGER.debug("rename %s %s" % (path, path1))
        d = self.get_dir(path)

        if self.is_valid_file(path) and d.is_file(path):
            if not self.is_valid_file(path1):
                # from a valid file to an editor file               
                buf = self.get_file_buf(path1)
                buf.write(d.read_file(path))
                # TODO : remove path ?
            else:
                # from a valid file to a valid file
                # if rename is defined 
                # TODO : with unlink method defined in fs
                pass
        elif not self.is_valid_file(path):
            if self.is_valid_file(path1) and d.is_file(path1):
                # from an editor file to a valid file
                buf = self.get_file_buf(path)
                ret = d.write_to(path1, buf.getvalue())
                self.open_mode = None
                self.remove_file_buf(path)
                if ret == False:
                    return -errno.EIO
            elif not self.is_valid_file(path):
                # from an editor file to an editor file
                # TODO
                pass
开发者ID:cscott,项目名称:wikipediafs,代码行数:29,代码来源:metadir.py

示例6: get_custom_field

 def get_custom_field(self, field_key):
     result = ''
     try:
         result = self.custom_fields[field_key]
     except KeyError:
         LOGGER.warn('Issue %s does not have value for field %s' % (self.key, field_key))
     return result
开发者ID:OleksiiZhmyrov,项目名称:Aurora,代码行数:7,代码来源:jira.py

示例7: update_issue_status

 def update_issue_status(status_list):
     for item in status_list:
         status = item['status'].upper()
         key = item['key']
         update_query = DbJiraIssues.update(dc_status=status).where(DbJiraIssues.key == key)
         update_query.execute()
         LOGGER.debug(update_query)
开发者ID:OleksiiZhmyrov,项目名称:Aurora,代码行数:7,代码来源:database.py

示例8: end_suite

 def end_suite(self, suite):
     self._separator('SUITE')
     self._end('SUITE', suite.longname, suite.elapsedtime)
     self._separator('SUITE')
     if self._indent == 0:
         LOGGER.output_file('Debug', self._file.name)
         self.close()
开发者ID:superbaby11,项目名称:autoOMC,代码行数:7,代码来源:debugfile.py

示例9: format_date

def format_date(date_string):
    result = date_string
    try:
        time_struct = strptime(date_string, "%d/%b/%y")
        result = date.fromtimestamp(mktime(time_struct))
    except (TypeError, ValueError):
        LOGGER.warn('[%s] is not valid date' % date_string)
    return result
开发者ID:OleksiiZhmyrov,项目名称:Aurora,代码行数:8,代码来源:util.py

示例10: unlink

 def unlink(self, path):
     LOGGER.debug("FSdir unlink %s" % (path))
     file_name = self.get_article_file_name(path)
     if self.files.has_key(file_name):
         self.files.pop(file_name)
         return True # succeeded
     else:
         return False
开发者ID:cscott,项目名称:wikipediafs,代码行数:8,代码来源:fs.py

示例11: updateOne

 def updateOne(self,ident):
 	"""
 		Ask for update the sensor with this id
 	"""
 	LOGGER.info("lazily updating {}".format(ident))
 	self.idToUpdate=ident
 	self.newState=''
 	self.save()
开发者ID:Minizza,项目名称:ghome,代码行数:8,代码来源:update.py

示例12: translateTrame

 def translateTrame(self,inTrame):
     """
     return the temperature (range 0-40 c) from data byte 2 
     """
     rowTemp=int(inTrame.data1,16)
     temperature = round((rowTemp*40/255.0),3)
     LOGGER.info("Temperature sensor {} with temp {}".format(inTrame.ident, temperature))
     return temperature
开发者ID:Minizza,项目名称:ghome,代码行数:8,代码来源:temperature.py

示例13: sendTrame

 def sendTrame(self,ident,newState):
 	"""
 		Ask the traductor to send a trame with the new state of a captor
 	"""
 	LOGGER.info("Lazily updating {} with {}".format(ident,newState))
 	self.idToUpdate=ident
 	self.newState=newState
 	self.save()
开发者ID:Minizza,项目名称:ghome,代码行数:8,代码来源:update.py

示例14: sendTrame

 def sendTrame(self,ident,newState):
     with self.lock:
         sensorUsed=sensor.Device.objects(physic_id=ident)[0]
     daTrame=sensorUsed.gimmeTrame(newState)
     if daTrame:
         self.soc.send(daTrame)
         LOGGER.info("Trame sended : {}".format(daTrame))
         return
开发者ID:Minizza,项目名称:ghome,代码行数:8,代码来源:traductor.py

示例15: receive

 def receive (self) :
     # LOGGER.debug("en attente de trame")
     message = self.soc.recv(1024)
     if message and len(message)==28:
         LOGGER.debug("trame reçu : {}".format(message))
         self.trameUsed = Trame.trame(message)
     else :
         return
开发者ID:Minizza,项目名称:ghome,代码行数:8,代码来源:traductor.py


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