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


Python Logger.getLogger方法代码示例

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


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

示例1: writeConfigurationOnEmulator

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
    def writeConfigurationOnEmulator(emulator, idXP, reportingConfiguration):
        logger = Logger.getLogger(__name__)
        configurationContent = """# Hooker Analysis Configuration File
# Network configuration
[elasticsearch]
elasticsearch_mode={0}
elasticsearch_nb_thread={1}
elasticsearch_ip={2}
elasticsearch_port={3}
elasticsearch_index={4}
elasticsearch_doctype={5}

# File configuration
[file]
file_mode={6}
file_name={7}

[analysis]
idXP={8}
""".format(reportingConfiguration.elasticsearchMode,
           1,
           "10.0.2.2",
           reportingConfiguration.elasticsearchPort,           
           reportingConfiguration.elasticsearchIndex,
           reportingConfiguration.elasticsearchDoctype,           
           reportingConfiguration.fileMode,
           "events.logs",
           idXP)
        logger.debug("Deploy the following configuration on emulator {0}: \n{1}".format(emulator.name, configurationContent))

        # Write on the emulator
        emulator.writeContentOnSdCard("experiment.conf", configurationContent)
开发者ID:100325128,项目名称:hooker,代码行数:34,代码来源:Analysis.py

示例2: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
 def __init__(self, esNodes):
     """Creates and initializes the connection to the specified elasticsearch cluster.
     The esNodes attributes refers to a list of nodes we should connect to."""
     
     self._logger = Logger.getLogger(__name__)
     self.esNodes = esNodes
     self.__initializeConnection()
开发者ID:AvalZ,项目名称:hooker,代码行数:9,代码来源:Es.py

示例3: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
 def __init__(self, adbPort, name, mainConfiguration):
     self._logger = Logger.getLogger(__name__)
     self.name = name
     self.mainConfiguration = mainConfiguration
     self.adbPort = adbPort
     self._hookerDir = "/mnt/sdcard/hooker/"
     self.serialNumber = ''
     self.state = AndroidDevice.STATE_NOT_PREPARED
开发者ID:AvalZ,项目名称:hooker,代码行数:10,代码来源:AndroidDevice.py

示例4: executeCommand

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
    def executeCommand(commandAndArgs):
        logger = Logger.getLogger(__name__)

        if isinstance(commandAndArgs, str):
            commandAndArgs = shlex.split(commandAndArgs)
        
        logger.debug("Executing command {0}".format(commandAndArgs))
        return subprocess.check_output(commandAndArgs, stderr=subprocess.STDOUT)
开发者ID:100325128,项目名称:hooker,代码行数:10,代码来源:OSCommand.py

示例5: createTemporaryFolder

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
def createTemporaryFolder():
    """Create a random named temporary folder."""
    logger = Logger.getLogger(__name__)
    logger.debug("Create temporary directory.")
    
    tmpName = "tmp_"+str(uuid.uuid4())
    createDirectory(tmpName)
    return tmpName    
开发者ID:Bludge0n,项目名称:hooker,代码行数:10,代码来源:apk_retriever.py

示例6: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
 def __init__(self, reporter, idXp, emulator, emulatorNumber, host="127.0.0.1"):
     self._logger = Logger.getLogger(__name__)
     self.emulatorNumber = emulatorNumber
     self.emulator = emulator
     self.reporter = reporter
     self.idXp = idXp
     self.__telnetPort = 5554 + (self.emulatorNumber*2)
     self.__emulatorSerialNumber = "emulator-{0}".format(self.__telnetPort)
     self.__host = host
开发者ID:Bludge0n,项目名称:hooker,代码行数:11,代码来源:TelnetEmulation.py

示例7: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
 def __init__(self, emulatorNumber, name, mainConfiguration):        
     self._logger = Logger.getLogger(__name__)
     self.name = name
     self.state = AVDEmulator.STATE_NOT_PREPARED
     self.mainConfiguration = mainConfiguration
     self.emulatorNumber = emulatorNumber
     self.emulatorPort = 5554 + (self.emulatorNumber*2)
     self.emulatorSerialNumber = "emulator-{0}".format(self.emulatorPort)
     self.__emulatorProcess = None
     self.__duplicateAVD()
开发者ID:Bludge0n,项目名称:hooker,代码行数:12,代码来源:AVDEmulator.py

示例8: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
 def __init__(self, avdName, avdDir, sdkPath):
     self._logger = Logger.getLogger(__name__)
     self.__avdName = avdName
     self.__sdkPath = sdkPath
     self.__avdDir = avdDir
     self.__adbPath = "{}/platform-tools/adb".format(self.__sdkPath)
     self.__emulatorPath = "{}/tools/emulator".format(self.__sdkPath)
     self.__android_path = "{}/tools/android".format(self.__sdkPath)
     self.__emulatorProcess = None
     self.__arch = None
开发者ID:100325128,项目名称:hooker,代码行数:12,代码来源:HookerInstaller.py

示例9: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
    def __init__(self, emulatorId, name, mainConfiguration):
        self._logger = Logger.getLogger(__name__)
        super(AVDEmulator, self).__init__(5554 + (int(emulatorId) * 2), name, mainConfiguration)
        self.__emulatorProcess = None
        self.emulatorId = emulatorId
        self.__duplicateAVD()

        self.serialNumber = "emulator-{0}".format(self.adbPort)
        if self.mainConfiguration.typeOfDevice!='emulated':
            raise Exception("Type of device is not emulated, please check your configuration")
开发者ID:AvalZ,项目名称:hooker,代码行数:12,代码来源:AVDEmulator.py

示例10: executeCommand

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
    def executeCommand(commandAndArgs):
        logger = Logger.getLogger(__name__)

        if isinstance(commandAndArgs, str):
            commandAndArgs = shlex.split(commandAndArgs)
        
        logger.debug("Executing command {0}".format(commandAndArgs))
        try:
            return subprocess.check_output(commandAndArgs, stderr=subprocess.STDOUT)
        except Exception, e:
            logger.error("Error occured while executing command : {0}".format(e))
            return None
开发者ID:Bludge0n,项目名称:hooker,代码行数:14,代码来源:OSCommand.py

示例11: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
 def __init__(self, adbPort, name, mainConfiguration, backupDirectory, analysisType):
     super(PhysicalDevice, self).__init__(adbPort, name, mainConfiguration)
     self.__backupDir = backupDirectory
     self._logger = Logger.getLogger(__name__)
     
     # Check if backup directory contains 2 folders named sdcard and partitions
     self.__checkBackupDirectories()
     self.serialNumber = name
     self.analysisType = analysisType
     self.checkAPKInstrumenter()
     # Put the state directly in started, since there is no FS preparation for real device
     self.state = AndroidDevice.STATE_STARTED
开发者ID:100325128,项目名称:hooker,代码行数:14,代码来源:PhysicalDevice.py

示例12: createEmulator

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
    def createEmulator(emulatorNumber, emulatorName, mainConfiguration):        
        logger = Logger.getLogger(__name__)

        if emulatorNumber is None or int(emulatorNumber)<0:
            raise Exception("Cannot create an emulator with an invalid emulator number, must be >0")

        if emulatorName is None or len(emulatorName)==0:
            raise Exception("Cannot create an emulator if not name is provided.")
            
        
        logger.debug("Creation of new emulator named '{0}'.".format(emulatorName))
        return AVDEmulator(emulatorNumber, emulatorName, mainConfiguration)
开发者ID:Bludge0n,项目名称:hooker,代码行数:14,代码来源:Analysis.py

示例13: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
 def __init__(self):
     self._logger = Logger.getLogger(__name__)
     self.parser = None
     self.manualAnalysisRequested = False
     self.automaticAnalysisRequested = False
     self.mainOptions = dict()
     self.manualOptions = dict()
     self.automaticOptions = dict()
     self.reportingOptions = dict()
     
     self.usage = "usage: %prog [options]"
     self.__parse()
开发者ID:100325128,项目名称:hooker,代码行数:14,代码来源:CommandLine.py

示例14: __init__

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
 def __init__(self, reporter, idXp, emulator, host="127.0.0.1"):
     self._logger = Logger.getLogger(__name__)
     self.emulator = emulator
     self.emulatorNumber = emulator.emulatorId
     self.reporter = reporter
     self.idXp = idXp
     self.__telnetPort = 5554 + (self.emulatorNumber*2)
     self.__host = host
     
     if emulator.mainConfiguration.typeOfDevice=='emulated':
         self.__emulatorSerialNumber = "emulator-{0}".format(self.__telnetPort)
     else:
         self.__emulatorSerialNumber = emulator.name
开发者ID:AvalZ,项目名称:hooker,代码行数:15,代码来源:TelnetEmulation.py

示例15: createDirectory

# 需要导入模块: from hooker_common import Logger [as 别名]
# 或者: from hooker_common.Logger import getLogger [as 别名]
def createDirectory(directory, force=True):
    """Create the specified directory but fails if the directory already
    exists unless force is set to True. In that case, we delete it and re-create it"""
    logger = Logger.getLogger(__name__)
    logger.debug("Create directory {0} (force={1})".format(directory, force))
    
    if os.path.exists(directory):
        if force:
            shutil.rmtree(directory)
        else:
            raise Exception("Specified directoryalready exists, cannot create it.")
    else:
        os.mkdirs(directory)    
开发者ID:Bludge0n,项目名称:hooker,代码行数:15,代码来源:apk_retriever.py


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