jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1742744 - /jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java
Date Sun, 08 May 2016 10:27:26 GMT
On 8 May 2016 at 10:03, sebb <sebbaz@gmail.com> wrote:
> On 7 May 2016 at 21:00,  <pmouawad@apache.org> wrote:
>> Author: pmouawad
>> Date: Sat May  7 20:00:18 2016
>> New Revision: 1742744
>>
>> URL: http://svn.apache.org/viewvc?rev=1742744&view=rev
>> Log:
>> Add logging and contextual info
>>
>> Modified:
>>     jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java
>>
>> Modified: jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java
>> URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java?rev=1742744&r1=1742743&r2=1742744&view=diff
>> ==============================================================================
>> --- jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java
(original)
>> +++ jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java
Sat May  7 20:00:18 2016
>> @@ -140,7 +140,14 @@ public class ReportGenerator {
>>          this.resultCollector = resultCollector;
>>          this.testFile = file;
>>          final Properties merged = new Properties();
>> -        merged.putAll(loadProps(new File(JMeterUtils.getJMeterBinDir(), REPORTGENERATOR_PROPERTIES)));
>> +        File rgp = new File(JMeterUtils.getJMeterBinDir(), REPORTGENERATOR_PROPERTIES);
>> +        if(LOG.isInfoEnabled()) {
>> +            LOG.info("Reading report generator properties from:"+rgp.getAbsolutePath());
>> +        }
>> +        merged.putAll(loadProps(rgp));
>> +        if(LOG.isInfoEnabled()) {
>> +            LOG.info("Merging with JMeter properties");
>> +        }
>
> This logging is unnecessary; should be debug.
>
>>          merged.putAll(JMeterUtils.getJMeterProperties());
>>          configuration = ReportGeneratorConfiguration.loadFromProperties(merged);
>>      }
>> @@ -150,7 +157,7 @@ public class ReportGenerator {
>>          try (FileInputStream inStream = new FileInputStream(file)) {
>>              props.load(inStream);
>>          } catch (IOException e) {
>> -            LOG.error("Problem loading properties ", e);
>> +            LOG.error("Problem loading properties from file:"+file.getAbsolutePath(),
e);
>
> Unnecessary change.
> The Exception already includes the path name.

Note: the log now looks like:

2016/05/08 11:22:36 ERROR - jmeter.report.dashboard.ReportGenerator:
Problem loading properties from
file:/Users/user/Documents/workspace/JMeter/bin/reportgenerator.properties
java.io.FileNotFoundException:
/Users/user/Documents/workspace/JMeter/bin/reportgenerator.properties
(No such file or directory)

>
>>              System.err.println("Problem loading properties " + e);
>
> And if it doesn't include the name, then the above line also needs to
> be changed.
>
>>          }
>>          return props;
>>
>>

Mime
View raw message