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


Python slf4j.LoggerFactory类代码示例

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


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

示例1: __init__

  def __init__(self, args):
    self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)

    username = args[Constant.WH_DB_USERNAME_KEY]
    password = args[Constant.WH_DB_PASSWORD_KEY]
    JDBC_DRIVER = args[Constant.WH_DB_DRIVER_KEY]
    JDBC_URL = args[Constant.WH_DB_URL_KEY]
    self.input_table_file = args[Constant.ORA_SCHEMA_OUTPUT_KEY]
    self.input_field_file = args[Constant.ORA_FIELD_OUTPUT_KEY]
    self.input_sample_file = args[Constant.ORA_SAMPLE_OUTPUT_KEY]

    self.db_id = args[Constant.DB_ID_KEY]
    self.wh_etl_exec_id = args[Constant.WH_EXEC_ID_KEY]
    self.conn_mysql = zxJDBC.connect(JDBC_URL, username, password, JDBC_DRIVER)
    self.conn_cursor = self.conn_mysql.cursor()

    if Constant.INNODB_LOCK_WAIT_TIMEOUT in args:
      lock_wait_time = args[Constant.INNODB_LOCK_WAIT_TIMEOUT]
      self.conn_cursor.execute("SET innodb_lock_wait_timeout = %s;" % lock_wait_time)

    self.logger.info("Load Oracle Metadata into {}, db_id {}, wh_exec_id {}"
                     .format(JDBC_URL, self.db_id, self.wh_etl_exec_id))

    self.dict_dataset_table = 'dict_dataset'
    self.field_comments_table = 'field_comments'
    self.dict_field_table = 'dict_field_detail'
    self.dict_field_comment_table = 'dict_dataset_field_comment'
    self.dict_dataset_sample_table = 'dict_dataset_sample'
开发者ID:lzm7455,项目名称:WhereHows,代码行数:28,代码来源:OracleLoad.py

示例2: __init__

  def __init__(self, args):
    self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)
    self.app_id = int(args[Constant.JOB_REF_ID_KEY])
    self.wh_exec_id = long(args[Constant.WH_EXEC_ID_KEY])
    self.wh_con = zxJDBC.connect(args[Constant.WH_DB_URL_KEY],
                                 args[Constant.WH_DB_USERNAME_KEY],
                                 args[Constant.WH_DB_PASSWORD_KEY],
                                 args[Constant.WH_DB_DRIVER_KEY])
    self.wh_cursor = self.wh_con.cursor()
    self.aw_con = self.get_connection(args[Constant.AW_DB_URL_KEY],
                                      args[Constant.AW_DB_PORT_KEY],
                                      args[Constant.AW_DB_NAME_KEY],
                                      args[Constant.AW_DB_USERNAME_KEY],
                                      args[Constant.AW_DB_PASSWORD_KEY],
                                      args[Constant.AW_DB_DRIVER_KEY])
    self.aw_cursor = self.aw_con.cursor()
    self.lookback_period = args[Constant.AW_EXEC_ETL_LOOKBACK_KEY]
    self.app_folder = args[Constant.WH_APP_FOLDER_KEY]
    self.metadata_folder = self.app_folder + "/" + str(SchedulerType.APPWORX) + "/" + str(self.app_id)
    self.last_execution_unix_time = None
    self.get_last_execution_unix_time()

    if not os.path.exists(self.metadata_folder):
      try:
        os.makedirs(self.metadata_folder)
      except Exception as e:
        self.logger.error(e)
开发者ID:alyiwang,项目名称:WhereHows,代码行数:27,代码来源:AppworxExtract.py

示例3: __init__

  def __init__(self, args):
    self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)

    username = args[Constant.WH_DB_USERNAME_KEY]
    password = args[Constant.WH_DB_PASSWORD_KEY]
    JDBC_DRIVER = args[Constant.WH_DB_DRIVER_KEY]
    JDBC_URL = args[Constant.WH_DB_URL_KEY]

    self.db_id = args[Constant.JOB_REF_ID_KEY]
    self.wh_etl_exec_id = args[Constant.WH_EXEC_ID_KEY]
    self.conn_mysql = zxJDBC.connect(JDBC_URL, username, password, JDBC_DRIVER)
    self.conn_cursor = self.conn_mysql.cursor()

    if Constant.INNODB_LOCK_WAIT_TIMEOUT in args:
      lock_wait_time = args[Constant.INNODB_LOCK_WAIT_TIMEOUT]
      self.conn_cursor.execute("SET innodb_lock_wait_timeout = %s;" % lock_wait_time)

    temp_dir = FileUtil.etl_temp_dir(args, "ORACLE")
    self.input_table_file = os.path.join(temp_dir, args[Constant.ORA_SCHEMA_OUTPUT_KEY])
    self.input_field_file = os.path.join(temp_dir, args[Constant.ORA_FIELD_OUTPUT_KEY])
    self.input_sample_file = os.path.join(temp_dir, args[Constant.ORA_SAMPLE_OUTPUT_KEY])

    self.collect_sample = False
    if Constant.ORA_LOAD_SAMPLE in args:
      self.collect_sample = FileUtil.parse_bool(args[Constant.ORA_LOAD_SAMPLE], False)

    self.logger.info("Load Oracle Metadata into {}, db_id {}, wh_exec_id {}"
                     .format(JDBC_URL, self.db_id, self.wh_etl_exec_id))
开发者ID:linwenxue,项目名称:WhereHows,代码行数:28,代码来源:OracleLoad.py

示例4: __init__

  def __init__(self, hdfs_uri, kerberos=False, kerberos_principal=None, keytab_file=None):
    """
    :param hdfs_uri: hdfs://hadoop-name-node:port
    :param kerberos: optional, if kerberos authentication is needed
    :param kerberos_principal: optional, [email protected]
    :param keytab_file: optional, absolute path to keytab file
    """
    self.logger = LoggerFactory.getLogger(self.__class__.__name__)

    self.logger.info("keytab_file: " + keytab_file)

    hdfs_conf = Configuration()
    if hdfs_uri.startswith('hdfs://'):
      hdfs_conf.set(Hdfs.FS_DEFAULT_NAME_KEY, hdfs_uri)
    elif hdfs_uri > "":
      self.logger.error("%s is an invalid uri for hdfs namenode ipc bind." % hdfs_uri)

    if kerberos:  #  init kerberos and keytab
      if not kerberos_principal or not keytab_file or kerberos_principal == '' or keytab_file == '':
        print "Kerberos Principal and Keytab File Name/Path are required!"

      hdfs_conf.set("hadoop.security.authentication", "kerberos")
      hdfs_conf.set("dfs.namenode.kerberos.principal.pattern", "*")
      UserGroupInformation.setConfiguration(hdfs_conf)
      UserGroupInformation.loginUserFromKeytab(kerberos_principal, keytab_file)

    self.fs = Hdfs.get(hdfs_conf)

    requests.packages.urllib3.disable_warnings()
    self.logger.info("Initiated SchemaUrlHelper")
开发者ID:alyiwang,项目名称:WhereHows,代码行数:30,代码来源:SchemaUrlHelper.py

示例5: setLogLevel

def setLogLevel(level, loggerName='ROOT', temporary=True):
    """Set the log level for the given logger.
    
    Args:
        level: Logging level to set. Valid levels are 'TRACE', 'DEBUG', 'INFO',
               'WARN', 'ERROR', and 'OFF'.
                
    Optional Args:
        loggerName: Name of a specific 'logger'. Default value is 'ROOT'.
        temporary: Whether or not the logging level should be saved between
                   McIDAS-V sessions. Be aware that if set to True, loggerName
                   must be 'ROOT'. Default value is True.
                   
    Raises:
        ValueError: if temporary is True and loggerName is not 'ROOT'.
    """
    if not temporary:
        if loggerName != 'ROOT':
            raise ValueError(_BAD_LOGGERNAME % (loggerName))
        
        from edu.wisc.ssec.mcidasv.startupmanager.options import OptionMaster
        optMaster = OptionMaster.getInstance()
        optMaster.getLoggerLevelOption("LOG_LEVEL").setValue(level)
        optMaster.writeStartup()
        
    context = LoggerFactory.getILoggerFactory()
    logger = context.exists(loggerName)
    if not logger:
        logger = context.getLogger(loggerName)
    currentLevel = logger.getLevel()
    if not currentLevel:
        currentLevel = logger.getEffectiveLevel()
    convertedLevel = currentLevel.toLevel(level, currentLevel.INFO)
    logger.setLevel(convertedLevel)
开发者ID:davep-ssec,项目名称:mcidasv,代码行数:34,代码来源:interactive.py

示例6: setLogLevel

def setLogLevel(level):
    """setLogLevel(level) changes the log level to level, where level is a string (ERROR, WARN, INFO, DEBUG, and TRACE) """

    logger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME)
    levels = {"ERROR": Level.ERROR, "WARN": Level.WARN, "INFO": Level.INFO, "DEBUG": Level.DEBUG, "TRACE": Level.TRACE}
    l = levels[level.upper()]
    logger.setLevel(l)
开发者ID:carriercomm,项目名称:insteon-terminal,代码行数:7,代码来源:iofun.py

示例7: __init__

	def __init__(self, name='max',
				 labelList=('maxx','maxy','maxval', 'sum'),
				 keyxlabel='maxx', 
				 keyylabel='maxy', 
				 formatString='Maximum value found to be at %f,%f (maxx,maxy) was %f (maxval). Sum was %f (sum)'
				 ):
		self.logger = LoggerFactory.getLogger("SumMaxPositionAndValue:%s" % name)
		TwodDataSetProcessor.__init__(self, name, labelList, keyxlabel, keyylabel, formatString)
开发者ID:openGDA,项目名称:gda-core,代码行数:8,代码来源:SumMaxPositionAndValue.py

示例8: __init__

 def __init__(self, args):
   self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)
   self.wh_con = zxJDBC.connect(args[Constant.WH_DB_URL_KEY],
                                args[Constant.WH_DB_USERNAME_KEY],
                                args[Constant.WH_DB_PASSWORD_KEY],
                                args[Constant.WH_DB_DRIVER_KEY])
   self.wh_cursor = self.wh_con.cursor()
   self.app_id = int(args[Constant.JOB_REF_ID_KEY])
开发者ID:alyiwang,项目名称:WhereHows,代码行数:8,代码来源:GitLoad.py

示例9: __init__

 def __init__(self, args):
   self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)
   self.elasticsearch_index_url = args[Constant.WH_ELASTICSEARCH_URL_KEY]
   self.elasticsearch_port = args[Constant.WH_ELASTICSEARCH_PORT_KEY]
   self.wh_con = zxJDBC.connect(args[Constant.WH_DB_URL_KEY],
                                args[Constant.WH_DB_USERNAME_KEY],
                                args[Constant.WH_DB_PASSWORD_KEY],
                                args[Constant.WH_DB_DRIVER_KEY])
   self.wh_cursor = self.wh_con.cursor(1)
开发者ID:jerrybai2009,项目名称:WhereHows-1,代码行数:9,代码来源:ElasticSearchIndex.py

示例10: __init__

 def __init__(self, args):
   self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)
   self.wh_con = zxJDBC.connect(args[Constant.WH_DB_URL_KEY],
                                args[Constant.WH_DB_USERNAME_KEY],
                                args[Constant.WH_DB_PASSWORD_KEY],
                                args[Constant.WH_DB_DRIVER_KEY])
   self.wh_cursor = self.wh_con.cursor()
   self.wh_exec_id = long(args[Constant.WH_EXEC_ID_KEY])
   self.app_folder = args[Constant.WH_APP_FOLDER_KEY]
开发者ID:dmoore247,项目名称:WhereHows,代码行数:9,代码来源:OwnerLoad.py

示例11: __init__

 def __init__(self):
   self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)
   username = args[Constant.HIVE_METASTORE_USERNAME]
   password = args[Constant.HIVE_METASTORE_PASSWORD]
   jdbc_driver = args[Constant.HIVE_METASTORE_JDBC_DRIVER]
   jdbc_url = args[Constant.HIVE_METASTORE_JDBC_URL]
   self.conn_hms = zxJDBC.connect(jdbc_url, username, password, jdbc_driver)
   self.curs = self.conn_hms.cursor()
   dependency_instance_file = args[Constant.HIVE_DEPENDENCY_CSV_FILE_KEY]
   self.instance_writer = FileWriter(dependency_instance_file)
开发者ID:CSRedRat,项目名称:WhereHows,代码行数:10,代码来源:HiveTransform.py

示例12: __init__

 def __init__(self, args, scheduler_type):
   self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)
   self.app_id = int(args[Constant.APP_ID_KEY])
   self.wh_con = zxJDBC.connect(args[Constant.WH_DB_URL_KEY],
                                args[Constant.WH_DB_USERNAME_KEY],
                                args[Constant.WH_DB_PASSWORD_KEY],
                                args[Constant.WH_DB_DRIVER_KEY])
   self.wh_cursor = self.wh_con.cursor()
   self.app_folder = args[Constant.WH_APP_FOLDER_KEY]
   self.metadata_folder = self.app_folder + "/" + str(scheduler_type) + "/" + str(self.app_id)
开发者ID:dmoore247,项目名称:WhereHows,代码行数:10,代码来源:SchedulerTransform.py

示例13: __init__

	def __init__(self, path, iFileLoader=None, fileLoadTimout=None, printNfsTimes=False, wait_for_exposure_callable=None):
		self.logger = LoggerFactory.getLogger("LazyDataSetProvider:%s" % path)
		self.path = path
		self.iFileLoader = iFileLoader
		self.fileLoadTimout = fileLoadTimout
		self.printNfsTimes = printNfsTimes
		self.wait_for_exposure_callable = wait_for_exposure_callable
		
		self.configureLock = threading.Lock()
		self.dataset = None
开发者ID:openGDA,项目名称:gda-core,代码行数:10,代码来源:DatasetProvider.py

示例14: getLogFile

def getLogFile():
    # TODO(jon): this will likely have to change as the complexity of
    #            logback.xml increases. :(
    # should return the "default" logging context
    context = LoggerFactory.getILoggerFactory()
    assert context.getName() == 'default', _CONTEXT_ASSERT_MSG % context.getName()
    logger = context.getLogger(Logger.ROOT_LOGGER_NAME)
    # for now I'll assume that there's only ONE appender per logger
    appender = [x for x in logger.iteratorForAppenders()].pop()
    assert isinstance(appender, FileAppender), _APPENDER_ASSERT_MSG % type(appender).getCanonicalName()
    return appender.getFile()
开发者ID:RickKohrs,项目名称:mcidasv,代码行数:11,代码来源:interactive.py

示例15: __init__

  def __init__(self):
    self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__)
    requests.packages.urllib3.disable_warnings()
    self.app_id = int(args[Constant.APP_ID_KEY])
    self.wh_exec_id = long(args[Constant.WH_EXEC_ID_KEY])
    self.project_writer = FileWriter(args[Constant.GIT_PROJECT_OUTPUT_KEY])
    self.repo_writer = FileWriter(args[Constant.PRODUCT_REPO_OUTPUT_KEY])
    self.repo_owner_writer = FileWriter(args[Constant.PRODUCT_REPO_OWNER_OUTPUT_KEY])

    self.multiproduct = {}
    self.git_repo = {}
    self.product_repo = []
开发者ID:dmoore247,项目名称:WhereHows,代码行数:12,代码来源:MultiproductExtract.py


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