def set_log_level(self, log_level): """ 设置logger的日志级别 @type log_level: int @param log_level: one of logging.DEBUG,logging.INFO,logging.WARNING,logging.ERROR,logging.CRITICAL """ CMQLogger.validate_loglevel(log_level) self.logger.setLevel(log_level) self.cmq_client.set_log_level(log_level)
def __init__(self, host, secretId, secretKey, version="SDK_Python_1.3", logger=None): self.host, self.is_https = self.process_host(host) self.secretId = secretId self.secretKey = secretKey self.version = version self.logger = CMQLogger.get_logger() if logger is None else logger self.http = CMQHttp(self.host, logger=logger, is_https=self.is_https) self.sign_method = 'sha1' if self.logger: self.logger.debug( "InitClient Host:%s Version:%s" % (host, version)) self.method = 'POST'
def __init__(self, host, secretId, secretKey, debug=False): """ @type host: string @param host: 访问的url,例如:https://cmq-queue-gz.api.qcloud.com @type secretId: string @param secretId: 用户的secretId, 腾讯云官网获取 @type secretKey: string @param secretKey: 用户的secretKey,腾讯云官网获取 @note: Exception :: CMQClientParameterException host格式错误 """ self.secretId = secretId self.secretKey = secretKey self.debug = debug self.logger = CMQLogger.get_logger() self.cmq_client = CMQClient(host, secretId, secretKey, logger=self.logger)
def set_log_level(self, log_level): if self.logger: CMQLogger.validate_loglevel(log_level) self.logger.setLevel(log_level) self.http.set_log_level(log_level)