Skip to content

Commit

Permalink
#1367 fix carriage return
Browse files Browse the repository at this point in the history
- fix rebase conflict
  • Loading branch information
xael-fry committed Jan 31, 2022
1 parent 7ccf446 commit 5a3e909
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 56 deletions.
13 changes: 6 additions & 7 deletions framework/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require: &allDependencies
- com.google.code.gson -> gson 2.8.9
- com.jamonapi -> jamon 2.82
- com.ning -> async-http-client 1.9.40
- commons-beanutils 1.9.4
- commons-beanutils 1.9.4
- commons-codec 1.15
- org.apache.commons -> commons-email 1.5
- commons-fileupload 1.4
Expand Down Expand Up @@ -71,7 +71,6 @@ require: &allDependencies
- io.netty -> netty 3.10.6.Final
- org.postgresql -> postgresql 42.3.1
- org.slf4j -> slf4j-api 1.7.33
- org.slf4j -> slf4j-log4j12 1.7.33
- org.apache.logging.log4j -> log4j-slf4j-impl 2.17.1
- org.yaml -> snakeyaml 1.30
- net.spy -> spymemcached 2.12.3
Expand All @@ -92,7 +91,7 @@ repositories:
type: local
artifact: "${play.path}/framework/lib/[artifact]-[revision].jar"
contains: *allDependencies

- playCoreCrud:
type: local
artifact: "${play.path}/modules/crud"
Expand All @@ -104,16 +103,16 @@ repositories:
artifact: "${play.path}/modules/secure"
contains:
- play -> secure $version

- playCoreDocviewer:
type: local
artifact: "${play.path}/modules/docviewer"
contains:
- play -> docviewer $version

- playModules:
- playModules:
type: chain
using:
using:
- playLocalModules:
type: local
descriptor: "${play.path}/modules/[module]-[revision]/conf/dependencies.yml"
Expand All @@ -123,7 +122,7 @@ repositories:
type: http
descriptor: "https://www.playframework.com/modules/repo/[module]/[revision]/dependencies.yml"
artifact: "https://www.playframework.com/modules/[module]-[revision].zip"

contains:
- play -> *

Expand Down
Binary file removed framework/lib/slf4j-api-1.7.32.jar
Binary file not shown.
Binary file removed framework/lib/slf4j-log4j12-1.7.33.jar
Binary file not shown.
11 changes: 7 additions & 4 deletions framework/src/play/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ static void init(LoggerInit init) {
Configurator.reconfigure(log4jConf.toURI());
configuredManually = true;
Logger.log4j = LogManager.getLogger("play");
} else {
System.out.println("ERRRRRRRRR");
}
} catch (IllegalArgumentException | FileSystemNotFoundException | SecurityException | URISyntaxException ignored) {
e.printStackTrace();
}
// In test mode, append logs to test-result/application.log
if (Play.runningInTestMode()) {
Expand Down Expand Up @@ -167,7 +170,7 @@ public static boolean isDebugEnabled() {
return log4j.isDebugEnabled();
}
}


/**
* @return true if log4j.trace / jul.finest logging is enabled
Expand All @@ -190,7 +193,7 @@ public static boolean isEnabledFor(String level) {
org.apache.logging.log4j.Level log4jLevel = org.apache.logging.log4j.Level.toLevel(level);
return isEnabledFor(log4jLevel);
}

/**
*
* @param log4jLevel Logging-levels as used in log4j
Expand All @@ -207,7 +210,7 @@ public static boolean isEnabledFor(org.apache.logging.log4j.Level log4jLevel) {
return log4j.isEnabled(log4jLevel);
}
}


/**
* Log with TRACE level
Expand Down Expand Up @@ -623,7 +626,7 @@ static boolean niceThrowable(org.apache.logging.log4j.Level level, Throwable e,
}

/**
* Try to format messages using java Formatter.
* Try to format messages using java Formatter.
* Fall back to the plain message if error.
*/
static String format(String msg, Object... args) {
Expand Down
12 changes: 6 additions & 6 deletions framework/test-src/play/LoggerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public void tearDown() throws Exception {
@Test
public void testInitWithPropertiesForDefaultRoot() {
//given
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsoluteFile() + "/test-src/play/testlog4j.properties");
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsolutePath() + "/test-src/play/testlog4j.properties");

Logger.log4j = null;
init();
//when
Expand All @@ -94,7 +95,7 @@ public void testInitWithPropertiesForDefaultRoot() {
@Test
public void testInitWithPropertiesForCustom() {
//given
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsoluteFile() + "/test-src/play/testlog4j.properties");
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsolutePath() + "/test-src/play/testlog4j.properties");
Logger.log4j = null;
init();
//when
Expand All @@ -109,7 +110,7 @@ public void testInitWithPropertiesForCustom() {
@Test
public void testInitWithPropertiesForPlay() {
//given
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsoluteFile() + "/test-src/play/testlog4j.properties");
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsolutePath() + "/test-src/play/testlog4j.properties");
Logger.log4j = null;
init();
//when
Expand All @@ -126,7 +127,7 @@ public void testInitWithPropertiesForPlay() {
@Test
public void testInitWithXMLForCustom() {
//given
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsoluteFile() + "/test-src/play/testlog4j.xml");
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsolutePath() + "/test-src/play/testlog4j.xml");
Logger.log4j = null;
init();
//when
Expand All @@ -141,7 +142,7 @@ public void testInitWithXMLForCustom() {
@Test
public void testInitWithXMLForPlay() {
//given
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsoluteFile() + "/test-src/play/testlog4j.xml");
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsolutePath() + "/test-src/play/testlog4j.xml");
Logger.log4j = null;
init();
//when
Expand All @@ -157,7 +158,6 @@ public URL getLog4jConf() {
try {
return new File(Play.configuration.getProperty(APPLICATION_LOG_PATH_PROPERTYNAME)).toURI().toURL();
} catch (MalformedURLException ignored) {

}
return super.getLog4jConf();
}
Expand Down
33 changes: 17 additions & 16 deletions framework/test-src/play/testlog4j.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# appender Console
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d [%t] %p %c - %m%n
appender.console.filter.threshold.type = ThresholdFilter
appender.console.filter.threshold.level = INFO
# play logger
logger.app.name = play
logger.app.level = INFO
# play logger
logger.custom.name = logtest.properties
logger.custom.level = WARN
# root logger
rootLogger.level = DEBUG
rootLogger.appenderRef.console.ref = STDOUT
# appender Console
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d [%t] %p %c - %m%n
appender.console.filter.threshold.type = ThresholdFilter
appender.console.filter.threshold.level = INFO
# play logger
logger.app.name = play
logger.app.level = INFO
# play logger
logger.custom.name = logtest.properties
logger.custom.level = WARN
# root logger
rootLogger.level = DEBUG
rootLogger.appenderRef.console.ref = STDOUT

46 changes: 23 additions & 23 deletions framework/test-src/play/testlog4j.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Configuration name="ConfigTest" status="ERROR" monitorInterval="5">
<Appenders>

<SystemPropertyArbiter propertyName="env" propertyValue="dev">
<Console name="Out">
<PatternLayout pattern="%m%n"/>
</Console>
</SystemPropertyArbiter>
<SystemPropertyArbiter propertyName="env" propertyValue="prod">
<List name="Out">
</List>
</SystemPropertyArbiter>

</Appenders>
<Loggers>
<Logger name="logtest.xml" level="trace" >
<AppenderRef ref="Out"/>
</Logger>
<Root level="debug">
<AppenderRef ref="Out"/>
</Root>
</Loggers>
</Configuration>
<Configuration name="ConfigTest" status="ERROR" monitorInterval="5">
<Appenders>

<SystemPropertyArbiter propertyName="env" propertyValue="dev">
<Console name="Out">
<PatternLayout pattern="%m%n"/>
</Console>
</SystemPropertyArbiter>
<SystemPropertyArbiter propertyName="env" propertyValue="prod">
<List name="Out">
</List>
</SystemPropertyArbiter>

</Appenders>
<Loggers>
<Logger name="logtest.xml" level="trace" >
<AppenderRef ref="Out"/>
</Logger>
<Root level="debug">
<AppenderRef ref="Out"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit 5a3e909

Please sign in to comment.