Просмотр исходного кода

+ Complain if CacheDir does not exist.
+ Note that caching does not work for "one big logfile" setups.

Christoph Berg 21 лет назад
Родитель
Сommit
7abbf2246a
3 измененных файлов с 16 добавлено и 1 удалено
  1. 6 0
      docs/Changelog
  2. 5 1
      docs/pisg-doc.xml
  3. 5 0
      modules/Pisg/Parser/Logfile.pm

+ 6 - 0
docs/Changelog

@@ -1,3 +1,9 @@
+pisg (0.66) - ??
+   Christoph:
+   * Cache:
+     + Complain if CacheDir does not exist.
+     + Note that caching does not work for "one big logfile" setups.
+
 pisg (0.65) - Fri Apr, 15th 2005
 pisg (0.65) - Fri Apr, 15th 2005
    Christoph:
    Christoph:
    * Karma didn't work well with nick aliases. It's still far from perfect,
    * Karma didn't work well with nick aliases. It's still far from perfect,

+ 5 - 1
docs/pisg-doc.xml

@@ -1065,8 +1065,12 @@
     Setting this option makes pisg dump the results of log parsing into cache
     Setting this option makes pisg dump the results of log parsing into cache
     files. The next time pisg is run, it compares the timestamp of the log(s)
     files. The next time pisg is run, it compares the timestamp of the log(s)
     with the timestamp stored in the cache file. When the log was not changed,
     with the timestamp stored in the cache file. When the log was not changed,
-    the cached data is used.
+    the cached data is used. (This means that it does not work if you only
+    have a single big logfile. Split the log at arbitrary points and use
+    <xref linkend="LogDir" /> or <xref linkend="Logfile" />="dir/*".)
+    </para>
 
 
+    <para>
     Note that the cache files should be deleted when the pisg config file is
     Note that the cache files should be deleted when the pisg config file is
     changed since the cache data uses the old config settings.
     changed since the cache data uses the old config settings.
     <xref linkend="NickTracking" /> does not work especially well with the
     <xref linkend="NickTracking" /> does not work especially well with the

+ 5 - 0
modules/Pisg/Parser/Logfile.pm

@@ -124,6 +124,11 @@ sub analyze
         day_times => [ undef ],
         day_times => [ undef ],
     );
     );
 
 
+    if ($self->{cfg}->{cachedir} and not -d $self->{cfg}->{cachedir}) {
+        print STDERR "CacheDir \"$self->{cfg}->{cachedir}\" not found. Skipping caching.\n";
+        delete $self->{cfg}->{cachedir};
+    }
+
     foreach my $logfile (@logfiles) {
     foreach my $logfile (@logfiles) {
         # Run through the logfile
         # Run through the logfile
         print "Analyzing log $logfile... " unless ($self->{cfg}->{silent});
         print "Analyzing log $logfile... " unless ($self->{cfg}->{silent});