Skip to content

Commit 9d37ee9

Browse files
committed
[#2130] remove annoying log messages from autotest
1 parent df57115 commit 9d37ee9

File tree

3 files changed

+66
-6
lines changed

3 files changed

+66
-6
lines changed

framework/pym/play/commands/autotest.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,17 @@ def autotest(app, args):
118118
if app.readConf('headlessBrowser'):
119119
headless_browser = app.readConf('headlessBrowser')
120120

121-
fpcp = [os.path.join(app.play_env["basedir"], 'modules/testrunner/lib/play-testrunner.jar')]
121+
fpcp = []
122+
fpcp.append(os.path.normpath(os.path.join(app.play_env["basedir"], 'modules/testrunner/conf')))
123+
fpcp.append(os.path.join(app.play_env["basedir"], 'modules/testrunner/lib/play-testrunner.jar'))
122124
fpcp_libs = os.path.join(app.play_env["basedir"], 'modules/testrunner/firephoque')
123125
for jar in os.listdir(fpcp_libs):
124126
if jar.endswith('.jar'):
125127
fpcp.append(os.path.normpath(os.path.join(fpcp_libs, jar)))
126128
cp_args = ':'.join(fpcp)
127129
if os.name == 'nt':
128-
cp_args = ';'.join(fpcp)
129-
java_cmd = [java_path()] + add_options + ['-classpath', cp_args, '-Dapplication.url=%s://localhost:%s' % (protocol, http_port), '-DheadlessBrowser=%s' % (headless_browser), 'play.modules.testrunner.FirePhoque']
130+
cp_args = ';'.join(fpcp)
131+
java_cmd = [java_path()] + add_options + ['-Djava.util.logging.config.file=logging.properties', '-classpath', cp_args, '-Dapplication.url=%s://localhost:%s' % (protocol, http_port), '-DheadlessBrowser=%s' % (headless_browser), 'play.modules.testrunner.FirePhoque']
130132
if protocol == 'https':
131133
java_cmd.insert(-1, '-Djavax.net.ssl.trustStore=' + app.readConf('keystore.file'))
132134
try:
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
############################################################
2+
# Default Logging Configuration File
3+
#
4+
# You can use a different file by specifying a filename
5+
# with the java.util.logging.config.file system property.
6+
# For example java -Djava.util.logging.config.file=myfile
7+
############################################################
8+
9+
############################################################
10+
# Global properties
11+
############################################################
12+
13+
# "handlers" specifies a comma separated list of log Handler
14+
# classes. These handlers will be installed during VM startup.
15+
# Note that these classes must be on the system classpath.
16+
# By default we only configure a ConsoleHandler, which will only
17+
# show messages at the INFO and above levels.
18+
handlers= java.util.logging.ConsoleHandler
19+
20+
# To also add the FileHandler, use the following line instead.
21+
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
22+
23+
# Default global logging level.
24+
# This specifies which kinds of events are logged across
25+
# all loggers. For any given facility this global level
26+
# can be overriden by a facility specific level
27+
# Note that the ConsoleHandler also has a separate level
28+
# setting to limit messages printed to the console.
29+
.level= INFO
30+
31+
############################################################
32+
# Handler specific properties.
33+
# Describes specific configuration info for Handlers.
34+
############################################################
35+
36+
# default file output is in user's home directory.
37+
java.util.logging.FileHandler.pattern = %h/java%u.log
38+
java.util.logging.FileHandler.limit = 50000
39+
java.util.logging.FileHandler.count = 1
40+
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
41+
42+
# Limit the message that are printed on the console to INFO and above.
43+
java.util.logging.ConsoleHandler.level = INFO
44+
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
45+
46+
# Example to customize the SimpleFormatter output format
47+
# to print one-line log message like this:
48+
# <level>: <log message> [<date/time>]
49+
#
50+
# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n
51+
52+
############################################################
53+
# Facility specific properties.
54+
# Provides extra control for each logger.
55+
############################################################
56+
57+
# For example, set the com.xyz.foo logger to only log SEVERE
58+
# messages:
59+
com.gargoylesoftware.htmlunit.DefaultCssErrorHandler = OFF
60+
com.gargoylesoftware.htmlunit = OFF
61+
org.apache.http.impl.execchain.RetryExec = OFF

modules/testrunner/src/play/modules/testrunner/FirePhoque.java

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ public class FirePhoque {
3232

3333
public static void main(String[] args) throws Exception {
3434

35-
Logger.getLogger(DefaultCssErrorHandler.class.getName()).setLevel(Level.OFF);
36-
Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);
37-
3835
String app = System.getProperty("application.url", "http://localhost:9000");
3936

4037
// Tests description

0 commit comments

Comments
 (0)