Ejemplo n.º 1
0
	def init_log():
		LogOper.logger = {}
		log_name = LOG_OPER.get('name') + '_' + get_date()
		if log_name not in LogOper.logger:
			log_format = logging.Formatter('[%(asctime)s],%(message)s', '%Y-%m-%d %H:%M:%S')
			log_level = getattr(logging, LOG_OPER.get('level'))
			log_path = LOG_OPER.get('path') + '_' + get_date()
			log_path = config.project_home + '/' + log_path
			LogOper.logger[log_name] = get_logger(log_name, log_path, log_level, log_format)
Ejemplo n.º 2
0
	def info(text, up=1):
		try:
			local_logger = LogOper.get_local_logger(LOG_OPER.get('name'))
			if local_logger:
				local_logger.info(text)
		except Exception, e:
			return