修改license、注释改成英文、增加changelog

pull/1095/head
yangjuanying 2 years ago
parent 3200c8fed4
commit d44d187501

@ -26,3 +26,4 @@
- fix:fix feign report -1 port bug. - fix:fix feign report -1 port bug.
- fix:upgrade spring version. - fix:upgrade spring version.
- fix:Update README-zh.md - fix:Update README-zh.md
- feature: support Polaris configuration center extension plugin interface and support dynamic modification of log levels.

@ -1,10 +1,18 @@
/* /*
* Copyright (c) 2023 www.tencent.com. * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
* All Rights Reserved. *
* This program is the confidential and proprietary information of * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* www.tencent.com ("Confidential Information"). You shall not disclose such *
* Confidential Information and shall use it only in accordance with * Licensed under the BSD 3-Clause License (the "License");
* the terms of the license agreement you entered into with www.tencent.com. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* *
*/ */

@ -68,7 +68,7 @@ public class PolarisConfigFileLocator implements PropertySourceLocator {
private final PolarisPropertySourceManager polarisPropertySourceManager; private final PolarisPropertySourceManager polarisPropertySourceManager;
private final Environment environment; private final Environment environment;
// 此类给一些客户定制化逻辑做一些特殊业务分组文件的配置处理 // this class provides customized logic for some customers to configure special business group files
private final PolarisConfigCustomExtensionLayer polarisConfigCustomExtensionLayer = PolarisServiceLoaderUtil.getPolarisConfigCustomExtensionLayer(); private final PolarisConfigCustomExtensionLayer polarisConfigCustomExtensionLayer = PolarisServiceLoaderUtil.getPolarisConfigCustomExtensionLayer();
public PolarisConfigFileLocator(PolarisConfigProperties polarisConfigProperties, PolarisContextProperties polarisContextProperties, ConfigFileService configFileService, PolarisPropertySourceManager polarisPropertySourceManager, Environment environment) { public PolarisConfigFileLocator(PolarisConfigProperties polarisConfigProperties, PolarisContextProperties polarisContextProperties, ConfigFileService configFileService, PolarisPropertySourceManager polarisPropertySourceManager, Environment environment) {

@ -50,7 +50,7 @@ public abstract class PolarisConfigPropertyAutoRefresher implements ApplicationL
private final AtomicBoolean registered = new AtomicBoolean(false); private final AtomicBoolean registered = new AtomicBoolean(false);
// 此类给一些客户定制化逻辑做一些特殊业务分组文件的配置处理 // this class provides customized logic for some customers to configure special business group files
private final PolarisConfigCustomExtensionLayer polarisConfigCustomExtensionLayer = PolarisServiceLoaderUtil.getPolarisConfigCustomExtensionLayer(); private final PolarisConfigCustomExtensionLayer polarisConfigCustomExtensionLayer = PolarisServiceLoaderUtil.getPolarisConfigCustomExtensionLayer();
public PolarisConfigPropertyAutoRefresher(PolarisConfigProperties polarisConfigProperties, PolarisPropertySourceManager polarisPropertySourceManager) { public PolarisConfigPropertyAutoRefresher(PolarisConfigProperties polarisConfigProperties, PolarisPropertySourceManager polarisPropertySourceManager) {
@ -108,7 +108,7 @@ public abstract class PolarisConfigPropertyAutoRefresher implements ApplicationL
LOGGER.info("[SCT Config] changed property = {}", configPropertyChangeInfo); LOGGER.info("[SCT Config] changed property = {}", configPropertyChangeInfo);
// 新增动态改变日志级别的能力 // new ability to dynamically change log levels
try { try {
if (changedKey.startsWith("logging.level") && changedKey.length() >= 14) { if (changedKey.startsWith("logging.level") && changedKey.length() >= 14) {
String loggerName = changedKey.substring(14); String loggerName = changedKey.substring(14);

@ -1,10 +1,19 @@
/* /*
* Copyright (c) 2023 www.tencent.com. * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
* All Rights Reserved. *
* This program is the confidential and proprietary information of * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* www.tencent.com ("Confidential Information"). You shall not disclose such *
* Confidential Information and shall use it only in accordance with * Licensed under the BSD 3-Clause License (the "License");
* the terms of the license agreement you entered into with www.tencent.com. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
*/ */
package com.tencent.cloud.polaris.config.adapter; package com.tencent.cloud.polaris.config.adapter;
@ -23,12 +32,12 @@ public final class PolarisServiceLoaderUtil {
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisServiceLoaderUtil.class); private static final Logger LOGGER = LoggerFactory.getLogger(PolarisServiceLoaderUtil.class);
private PolarisServiceLoaderUtil() { private PolarisServiceLoaderUtil() {
} }
// 此类给一些客户定制化逻辑做一些特殊业务分组文件的配置处理 // this class provides customized logic for some customers to configure special business group files
private static PolarisConfigCustomExtensionLayer polarisConfigCustomExtensionLayer; private static PolarisConfigCustomExtensionLayer polarisConfigCustomExtensionLayer;
static { static {
ServiceLoader<PolarisConfigCustomExtensionLayer> polarisConfigCustomExtensionLayerLoader = ServiceLoader.load(PolarisConfigCustomExtensionLayer.class); ServiceLoader<PolarisConfigCustomExtensionLayer> polarisConfigCustomExtensionLayerLoader = ServiceLoader.load(PolarisConfigCustomExtensionLayer.class);
Iterator<PolarisConfigCustomExtensionLayer> polarisConfigCustomExtensionLayerIterator = polarisConfigCustomExtensionLayerLoader.iterator(); Iterator<PolarisConfigCustomExtensionLayer> polarisConfigCustomExtensionLayerIterator = polarisConfigCustomExtensionLayerLoader.iterator();
// 一般就一个实现类,如果有多个,那么加载的是最后一个 // Generally, there is only one implementation class. If there are multiple, the last one is loaded
while (polarisConfigCustomExtensionLayerIterator.hasNext()) { while (polarisConfigCustomExtensionLayerIterator.hasNext()) {
polarisConfigCustomExtensionLayer = polarisConfigCustomExtensionLayerIterator.next(); polarisConfigCustomExtensionLayer = polarisConfigCustomExtensionLayerIterator.next();
LOGGER.info("[SCT Config] PolarisConfigFileLocator init polarisConfigCustomExtensionLayer:{}", polarisConfigCustomExtensionLayer); LOGGER.info("[SCT Config] PolarisConfigFileLocator init polarisConfigCustomExtensionLayer:{}", polarisConfigCustomExtensionLayer);

@ -112,7 +112,7 @@ public class PolarisConfigRefreshOptimizationListener implements ApplicationList
beanFactory.removeBeanDefinition(REFLECT_REBINDER_BEAN_NAME); beanFactory.removeBeanDefinition(REFLECT_REBINDER_BEAN_NAME);
} }
catch (BeansException e) { catch (BeansException e) {
// 如果这段代码出现removeBean异常不要影响主进程启动有些用户用法会导致polarisReflectPropertySourceAutoRefresher没加载这时候removeBeanDefinition会报错 // If there is a removeBean exception in this code, do not affect the main process startup. Some user usage may cause the polarisReflectPropertySourceAutoRefresher to not load, and the removeBeanDefinition will report an error
LOGGER.debug("removeRelatedBeansOfReflect occur error:", e); LOGGER.debug("removeRelatedBeansOfReflect occur error:", e);
} }
} }

@ -5,7 +5,7 @@ package com.tencent.cloud.polaris.config.logger;
*/ */
public enum Level { public enum Level {
/** 日志级别. */ /** log level. */
TRACE("TRACE"), DEBUG("DEBUG"), INFO("INFO"), WARN("WARN"), ERROR("ERROR"), FATAL("FATAL"), OFF("OFF"); TRACE("TRACE"), DEBUG("DEBUG"), INFO("INFO"), WARN("WARN"), ERROR("ERROR"), FATAL("FATAL"), OFF("OFF");
private String level; private String level;

@ -1,10 +1,19 @@
/* /*
* Copyright (c) 2018 www.tencent.com. * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
* All Rights Reserved. *
* This program is the confidential and proprietary information of * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* www.tencent.com ("Confidential Information"). You shall not disclose such *
* Confidential Information and shall use it only in accordance with * Licensed under the BSD 3-Clause License (the "License");
* the terms of the license agreement you entered into with www.tencent.com. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
*/ */
package com.tencent.cloud.polaris.config.logger; package com.tencent.cloud.polaris.config.logger;
@ -73,7 +82,7 @@ public final class PolarisConfigLoggerContext {
printLog("[SCT Config] PolarisConfigLoggerContext logger: [" + loggerName + "] changed to level:" + level, Level.INFO); printLog("[SCT Config] PolarisConfigLoggerContext logger: [" + loggerName + "] changed to level:" + level, Level.INFO);
} }
/** /**
* . * print log.
*/ */
private static void printLog(String message, Level level) { private static void printLog(String message, Level level) {
Logger logger = LoggerFactory.getLogger(ROOT_LOGGER_NAME); Logger logger = LoggerFactory.getLogger(ROOT_LOGGER_NAME);

Loading…
Cancel
Save