Hi,

I would like to add my script that use the progress log, wich is the
better way, a dif in this list as my patch ?

Regards

-- 
Rodolphe QuiƩdeville - Artisan Logiciel Libre
http://rodolphe.quiedeville.org/
Travaillons Libre - http://fr.lolix.org/
Index: tilesGen.pl
===================================================================
--- tilesGen.pl	(revision 8210)
+++ tilesGen.pl	(working copy)
@@ -487,12 +487,12 @@
 
     my ($runNumber) = @_;
 
-    keepLog("compress","start","$runNumber $progressJobs") if $Config->get("ProcessLog");
+    keepLog($PID,"compress","start","$runNumber $progressJobs") if $Config->get("ProcessLog");
 
     my $CompressScript = "perl $Bin/compress.pl $runNumber $progressJobs";
     my $retval = system($CompressScript);
 
-    keepLog("compress","stop","return=$retval") if $Config->get("ProcessLog");
+    keepLog($PID,"compress","stop","return=$retval") if $Config->get("ProcessLog");
 
     return $retval;
 }
@@ -504,12 +504,12 @@
 
     my ($runNumber) = @_;
 
-    keepLog("upload","start","$runNumber $progressJobs") if $Config->get("ProcessLog");
+    keepLog($PID,"upload","start","$runNumber $progressJobs") if $Config->get("ProcessLog");
 
     my $UploadScript = "perl $Bin/upload.pl $runNumber $progressJobs";
     my $retval = system($UploadScript);
 
-    keepLog("upload","stop","return=$retval") if $Config->get("ProcessLog");
+    keepLog($PID,"upload","stop","return=$retval") if $Config->get("ProcessLog");
 
     return $retval;
 }
@@ -703,7 +703,7 @@
 {
     my ($X, $Y, $Zoom) = @_;
     
-    keepLog("GenerateTileset","start","x=$X,y=$Y,z=$Zoom for layers $Layers") if $Config->get("ProcessLog");
+    keepLog($PID,"GenerateTileset","start","x=$X,y=$Y,z=$Zoom for layers $Layers") if $Config->get("ProcessLog");
     
     my ($N, $S) = Project($Y, $Zoom);
     my ($W, $E) = ProjectL($X, $Zoom);
@@ -1121,7 +1121,7 @@
 
     foreach my $file(@tempfiles) { killafile($file) if (!$Config->get("Debug")); }
 
-    keepLog("GenerateTileset","stop","x=$X,y=$Y,z=$Zoom for layers $Layers") if $Config->get("ProcessLog");
+    keepLog($PID,"GenerateTileset","stop","x=$X,y=$Y,z=$Zoom for layers $Layers") if $Config->get("ProcessLog");
 
     return 1;
 }
Index: tilesAtHome.conf.windows
===================================================================
--- tilesAtHome.conf.windows	(revision 8210)
+++ tilesAtHome.conf.windows	(working copy)
@@ -93,3 +93,7 @@
 # Set this to 1 if you want to clear the stopfile.txt on program start. 
 # may unintentionally clear stopfile.txt when (accidentally) running 2 instances
 AutoResetStopfile=0
+
+# Set this to 1 if you want to have som logs dump in ProcessLogFile
+ProcessLog=0
+ProcessLogFile="tah-process.log"
Index: tilesAtHome.conf.linux
===================================================================
--- tilesAtHome.conf.linux	(revision 8210)
+++ tilesAtHome.conf.linux	(working copy)
@@ -112,3 +112,7 @@
 # Set this to 1 if you want to clear the stopfile.txt on program start. 
 # may unintentionally clear stopfile.txt when (accidentally) running 2 instances
 AutoResetStopfile=0
+
+# Set this to 1 if you want to have som logs dump in ProcessLogFile
+ProcessLog=0
+ProcessLogFile="tah-process.log"
Index: tahconfig.pm
===================================================================
--- tahconfig.pm	(revision 8210)
+++ tahconfig.pm	(working copy)
@@ -70,6 +70,8 @@
     my $cmd;
     printf "- Using working directory %s\n", $Config->get("WorkingDirectory");
 
+    printf "- Using process log file %s\n", $Config->get("ProcessLogFile") if ($Config->get("ProcessLog"));
+
     if ($Config->get("Subversion"))
     {
         $cmd=$Config->get("Subversion");
Index: tahlib.pm
===================================================================
--- tahlib.pm	(revision 8210)
+++ tahlib.pm	(working copy)
@@ -374,13 +374,13 @@
 
 sub keepLog
 {
-    my ($Process,$Action,$Message) = @_;
+    my ($Pid,$Process,$Action,$Message) = @_;
     my $Config = $main::Config;
     my $logFile = $Config->get("ProcessLogFile");
 
     open(my $fpLog, ">>$logFile");
     if ($fpLog) {
-	print $fpLog time()." [".$Config->get("ClientVersion")."] $Process $Action $Message\n";
+	print $fpLog time()." [".$Config->get("ClientVersion")."] $Pid $Process $Action $Message\n";
 	close $fpLog;
     }
 }
_______________________________________________
Tilesathome mailing list
[email protected]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/tilesathome

Reply via email to