dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17238
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6794: Improved logging
------------------------------------------------------------
revno: 6794
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-01-01 01:37:33 +0100
message:
Improved logging
modified:
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/engine/DefaultDataSetCompletenessEngine.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/engine/DefaultDataSetCompletenessEngine.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/engine/DefaultDataSetCompletenessEngine.java 2013-01-01 00:28:39 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/engine/DefaultDataSetCompletenessEngine.java 2013-01-01 00:37:33 +0000
@@ -35,8 +35,6 @@
import java.util.List;
import java.util.concurrent.Future;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.completeness.DataSetCompletenessEngine;
import org.hisp.dhis.completeness.DataSetCompletenessService;
import org.hisp.dhis.completeness.DataSetCompletenessStore;
@@ -49,6 +47,7 @@
import org.hisp.dhis.period.RelativePeriods;
import org.hisp.dhis.setting.SystemSettingManager;
import org.hisp.dhis.system.filter.DataSetWithOrganisationUnitsFilter;
+import org.hisp.dhis.system.util.Clock;
import org.hisp.dhis.system.util.ConcurrentUtils;
import org.hisp.dhis.system.util.ConversionUtils;
import org.hisp.dhis.system.util.FilterUtils;
@@ -62,8 +61,6 @@
public class DefaultDataSetCompletenessEngine
implements DataSetCompletenessEngine
{
- private static final Log log = LogFactory.getLog( DefaultDataSetCompletenessEngine.class );
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -133,18 +130,18 @@
{
final int cpuCores = SystemUtils.getCpuCores();
- log.info( "Data completeness export process started" );
+ Clock clock = new Clock().startClock().logTime( "Data completeness export process started, number of CPU cores: " + cpuCores + ", " + SystemUtils.getMemoryString() );
completenessStore.dropIndex();
- log.info( "Dropped potential index" );
+ clock.logTime( "Dropped potential index" );
int days = (Integer) systemSettingManager.getSystemSetting( KEY_COMPLETENESS_OFFSET,
DEFAULT_COMPLETENESS_OFFSET );
completenessStore.deleteDataSetCompleteness( dataSetIds, periodIds, organisationUnitIds );
- log.info( "Deleted existing completeness data" );
+ clock.logTime( "Deleted existing completeness data" );
Collection<Period> periods = periodService.getPeriods( periodIds );
Collection<OrganisationUnit> organisationUnits = organisationUnitService.getOrganisationUnits( organisationUnitIds );
@@ -167,8 +164,8 @@
completenessStore.createIndex();
- log.info( "Created index" );
+ clock.logTime( "Created index" );
- log.info( "Completeness export process done" );
+ clock.logTime( "Completeness export process completed" );
}
}