Skip to content

Commit

Permalink
upgrade sofa-common-tools to 1.3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
寻芳 committed Jun 1, 2023
1 parent c78cc50 commit 9d2caef
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void test() throws IOException {
Map<String, Object> properties = new HashMap<>();
properties.put(Constants.SOFA_MIDDLEWARE_ALL_LOG_CONSOLE_SWITCH, "true");
properties.put(Constants.SOFA_MIDDLEWARE_ALL_LOG_CONSOLE_LEVEL, "debug");
properties.put("logging.level.test.space", "info");
properties
.put(String.format(Constants.SOFA_MIDDLEWARE_SINGLE_LOG_CONSOLE_SWITCH, TEST_SPACE),
"false");
Expand All @@ -63,7 +64,7 @@ public void test() throws IOException {
logger.debug("debug level");
List<String> contents = FileUtils.readLines(logFile,
environment.getProperty(Constants.LOG_ENCODING_PROP_KEY));
Assert.assertEquals(2, contents.size());
Assert.assertEquals(1, contents.size());
Assert.assertTrue(contents.get(0).contains("info level"));
Assert.assertFalse(outContent.toString().contains("info level"));
Assert.assertFalse(outContent.toString().contains("debug level"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void test() throws IOException {
Map<String, Object> properties = new HashMap<>();
properties.put(Constants.SOFA_MIDDLEWARE_ALL_LOG_CONSOLE_SWITCH, "true");
properties.put(Constants.SOFA_MIDDLEWARE_ALL_LOG_CONSOLE_LEVEL, "debug");
properties.put("logging.level.test.space", "info");
properties
.put(String.format(Constants.SOFA_MIDDLEWARE_SINGLE_LOG_CONSOLE_SWITCH, TEST_SPACE),
"false");
Expand All @@ -63,7 +64,7 @@ public void test() throws IOException {
logger.debug("debug level");
List<String> contents = FileUtils.readLines(logFile,
environment.getProperty(Constants.LOG_ENCODING_PROP_KEY));
Assert.assertEquals(2, contents.size());
Assert.assertEquals(1, contents.size());
Assert.assertTrue(contents.get(0).contains("info level"));
Assert.assertFalse(outContent.toString().contains("info level"));
Assert.assertFalse(outContent.toString().contains("debug level"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class GlobbingLogLevelTest extends LogTestBase {
public void test() throws IOException {
Map<String, Object> properties = new HashMap<>();
properties.put(Constants.LOG_LEVEL_PREFIX + "test.*", "debug");
properties.put("logging.level.test.space", "debug");
SpringApplication springApplication = new SpringApplication(EmptyConfig.class);
springApplication.setDefaultProperties(properties);
ConfigurableApplicationContext applicationContext = springApplication.run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void testSpaceConsoleLevelConfig() {
String.format(Constants.SOFA_MIDDLEWARE_SINGLE_LOG_CONSOLE_SWITCH, TEST_SPACE), "true");
properties.put(
String.format(Constants.SOFA_MIDDLEWARE_SINGLE_LOG_CONSOLE_LEVEL, TEST_SPACE), "debug");
properties.put("logging.level.test.space", "debug");
SpringApplication springApplication = new SpringApplication(EmptyConfig.class);
springApplication.setDefaultProperties(properties);
springApplication.run();
Expand Down

0 comments on commit 9d2caef

Please sign in to comment.