]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Better log message in plugins.
authoreldy <>
Fri, 21 May 2004 21:22:52 +0000 (21:22 +0000)
committereldy <>
Fri, 21 May 2004 21:22:52 +0000 (21:22 +0000)
wwwroot/cgi-bin/plugins/detectrefererspam.pm
wwwroot/cgi-bin/plugins/geoip.pm
wwwroot/cgi-bin/plugins/geoipfree.pm
wwwroot/cgi-bin/plugins/hashfiles.pm
wwwroot/cgi-bin/plugins/hostinfo.pm
wwwroot/cgi-bin/plugins/ipv6.pm
wwwroot/cgi-bin/plugins/rawlog.pm
wwwroot/cgi-bin/plugins/tooltips.pm
wwwroot/cgi-bin/plugins/urlalias.pm
wwwroot/cgi-bin/plugins/userinfo.pm

index e182e8ac720dcfd90728f64d02ad47fb2cb09025..772ad200fb2137c3c817b50fb1660fa8a362011f 100644 (file)
@@ -16,7 +16,7 @@ use strict;no strict "refs";
 #-----------------------------------------------------------------------------
 # PLUGIN VARIABLES
 #-----------------------------------------------------------------------------
-my $PluginNeedAWStatsVersion="5.6";
+my $PluginNeedAWStatsVersion="6.2";
 my $PluginHooksFunctions="ScanForRefererSpam";
 
 # <-----
@@ -51,7 +51,7 @@ sub Init_detectrefererspam {
 #--------------------------------------------------------------------
 sub ScanForRefererSpam_detectrefererspam
 {
-       debug("Call to ScanForRefererSpam",5);
+       debug(" Plugin detectrefererspam: Call to ScanForRefererSpam",5);
 
 }
 
index 391f749e60f8d58a3040893e84dfb8238f8a8c4a..97c5f8c3ab58bca76189fa613cf22b8f504e873c 100644 (file)
@@ -51,7 +51,7 @@ sub Init_geoip {
 
        # <-----
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
-       debug(" InitParams=$InitParams",1);
+       debug(" Plugin geoip: InitParams=$InitParams",1);
        my $mode=$InitParams;
        if ($type eq 'geoippureperl') {
                if ($mode eq '' || $mode eq 'GEOIP_MEMORY_CACHE')  { $mode=Geo::IP::PurePerl::GEOIP_MEMORY_CACHE(); }
@@ -61,7 +61,7 @@ sub Init_geoip {
                else { $mode=Geo::IP::GEOIP_STANDARD(); }
        }
        %TmpDomainLookup=();
-       debug(" GeoIP working in mode $type $mode",1);
+       debug(" Plugin geoip: GeoIP initialized in mode $type $mode",1);
        if ($type eq 'geoippureperl') {
                $gi = Geo::IP::PurePerl->new($mode);
        } else {
@@ -85,9 +85,9 @@ sub GetCountryCodeByName_geoip {
        if (! $res) {
                $res=lc($gi->country_code_by_name($param));
                $TmpDomainLookup{$param}=$res;
-               if ($Debug) { debug("  GetCountryCodeByName for $param: [$res]",5); }
+               if ($Debug) { debug("  Plugin geoip: GetCountryCodeByName for $param: [$res]",5); }
        }
-       elsif ($Debug) { debug("  GetCountryCodeByName for $param: Already resolved to $res",5); }
+       elsif ($Debug) { debug("  Plugin geoip: GetCountryCodeByName for $param: Already resolved to $res",5); }
        # ----->
        return $res;
 }
@@ -104,9 +104,9 @@ sub GetCountryCodeByAddr_geoip {
        if (! $res) {
                $res=lc($gi->country_code_by_addr($param));
                $TmpDomainLookup{$param}=$res;
-               if ($Debug) { debug("  GetCountryCodeByAddr for $param: $res",5); }
+               if ($Debug) { debug("  Plugin geoip: GetCountryCodeByAddr for $param: $res",5); }
        }
-       elsif ($Debug) { debug("  GetCountryCodeByAddr for $param: Already resolved to $res",5); }
+       elsif ($Debug) { debug("  Plugin geoip: GetCountryCodeByAddr for $param: Already resolved to $res",5); }
        # ----->
        return $res;
 }
index b148cb9d0352a64da92d0a9ec1079a8138032016..75472e50071d4188392a03a90e9204ae445526b1 100644 (file)
@@ -48,7 +48,7 @@ sub Init_geoipfree {
 
        # <-----
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
-       debug(" InitParams=$InitParams",1);
+       debug(" Plugin geoipfree: InitParams=$InitParams",1);
        %TmpDomainLookup=();
        $gi = Geo::IPfree::new();
 #      $gi->Faster;    # Do not enable Faster as the Memoize module is rarely available
@@ -72,9 +72,9 @@ sub GetCountryCodeByName_geoipfree {
                if ($res !~ /\w\w/) { $res='ip'; }
                else { $res=lc($res); }
                $TmpDomainLookup{$param}=$res;
-               if ($Debug) { debug("  GetCountryCodeByName for $param: $res",5); }
+               if ($Debug) { debug("  Plugin geoipfree: GetCountryCodeByName for $param: $res",5); }
        }
-       elsif ($Debug) { debug("  GetCountryCodeByName for $param: Already resolved to $res",5); }
+       elsif ($Debug) { debug("  Plugin geoipfree: GetCountryCodeByName for $param: Already resolved to $res",5); }
        # ----->
        return $res;
 }
@@ -93,9 +93,9 @@ sub GetCountryCodeByAddr_geoipfree {
                if ($res !~ /\w\w/) { $res='ip'; }
                else { $res=lc($res); }
                $TmpDomainLookup{$param}=$res;
-               if ($Debug) { debug("  GetCountryCodeByAddr for $param: $res",5); }
+               if ($Debug) { debug("  Plugin geoipfree: GetCountryCodeByAddr for $param: $res",5); }
        }
-       elsif ($Debug) { debug("  GetCountryCodeByAddr for $param: Already resolved to $res",5); }
+       elsif ($Debug) { debug("  Plugin geoipfree: GetCountryCodeByAddr for $param: Already resolved to $res",5); }
        # ----->
        return $res;
 }
index c188c3c1db37acac8fd4e20bcf31c0d6358760c9..3a09201aa928748498e28f023f84705db4e51f24 100644 (file)
@@ -64,7 +64,7 @@ sub SearchFile_hashfiles {
                my ($tmp1b,$tmp2b,$tmp3b,$tmp4b,$tmp5b,$tmp6b,$tmp7b,$tmp8b,$tmp9b,$datehash,$tmp10b,$tmp11b,$tmp12b) = stat("${searchdir}$dnscachefile$filesuffix.hash");
                if ($datesource && $datehash < $datesource) {
                        $PluginHashfilesUpToDate=0;
-                       debug(" Hash file not up to date. Will use source file $filetoload instead.");
+                       debug(" Plugin hashfiles: Hash file not up to date. Will use source file $filetoload instead.");
                }
                else {
                        # There is no source file or there is and hash file is up to date. We can just load hash file
@@ -73,7 +73,7 @@ sub SearchFile_hashfiles {
        }
        elsif ($filetoload) {
                $PluginHashfilesUpToDate=0;
-               debug(" Hash file not found. Will use source file $filetoload instead.");
+               debug(" Plugin hashfiles: Hash file not found. Will use source file $filetoload instead.");
        }
        # Change calling params
        $_[4]=$filetoload;
@@ -101,14 +101,14 @@ sub SaveHash_hashfiles {
        my ($filetosave,$hashtosave,$testifuptodate,$nbmaxofelemtosave,$nbofelemsaved)=@_;
        if (! $testifuptodate || ! $PluginHashfilesUpToDate) {
                $filetosave =~ s/(\.\w+)$//; $filetosave.=".hash";
-               debug(" Save data ".($nbmaxofelemtosave?"($nbmaxofelemtosave records max)":"(all records)")." into hash file $filetosave");
+               debug(" Plugin hashfiles: Save data ".($nbmaxofelemtosave?"($nbmaxofelemtosave records max)":"(all records)")." into hash file $filetosave");
                if (! $nbmaxofelemtosave || (scalar keys %$hashtosave <= $nbmaxofelemtosave)) {
                        # Save all hash array
                        eval('store(\%$hashtosave, "$filetosave");');
                        $_[4]=scalar keys %$hashtosave;
                }
                else {
-                       debug(" We need to resize hash to save from ".(scalar keys %$hashtosave)." to $nbmaxofelemtosave");
+                       debug(" Plugin hashfiles: We need to resize hash to save from ".(scalar keys %$hashtosave)." to $nbmaxofelemtosave");
                        # Save part of hash array
                        my $counter=0;
                        my %newhashtosave=();
index ad6a5dbdc425337670a979ab0535ccf371e72027..96c9db9c7c542a5591c760f2fb71bf9d85d88a80 100644 (file)
@@ -44,7 +44,7 @@ sub Init_hostinfo {
 
        # <-----
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
-       debug(" InitParams=$InitParams",1);
+       debug(" Plugin hostinfo: InitParams=$InitParams",1);
        # ----->
 
        return ($checkversion?$checkversion:"$PluginHooksFunctions");
@@ -160,7 +160,7 @@ sub BuildFullHTMLOutput_hostinfo {
 #      }
        if (! $ip) { $HostResolved=$Host; }
 
-       if ($Debug) { debug("  DirData=$DirData Host=$Host HostResolved=$HostResolved ",4); }
+       if ($Debug) { debug("  Plugin hostinfo: DirData=$DirData Host=$Host HostResolved=$HostResolved ",4); }
        my $w = new Net::XWhois Verbose=>$Debug, Cache=>$DirData, NoCache=>0, Timeout=>10, Domain=>$HostResolved;
 
        print "<br />\n";
index 7c195e2d24b6b77b83c6dc098ef03fcd7946f9e8..dd197fad3bfe4e3aeaa648bdf7601a2b7c68deeb 100644 (file)
@@ -44,7 +44,7 @@ sub Init_ipv6 {
 
        # <-----
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
-       debug(" InitParams=$InitParams",1);
+       debug(" Plugin ipv6: InitParams=$InitParams",1);
        $resolver = Net::DNS::Resolver->new;
        # ----->
 
@@ -62,7 +62,7 @@ sub GetResolvedIP_ipv6 {
        my $ip = new Net::IP($_[0]);
        my $reverseip= $ip->reverse_ip();
        my $query = $resolver->query($reverseip, "PTR");
-       if (! defined($query)) { return; }\r
+       if (! defined($query)) { return; }
        my @result=split(/\s/, ($query->answer)[0]->string);
        return $result[4];
        # ----->
index 66b3729b9c4c9b7a2b78e0e98c361a3139ac8d86..f277046354e89e5540996bba5e219ceef9c37e8f 100644 (file)
@@ -44,7 +44,7 @@ sub Init_rawlog {
 
        # <-----
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
-       debug(" InitParams=$InitParams",1);
+       debug(" Plugin rawlog: InitParams=$InitParams",1);
 
        if ($QueryString =~ /rawlog_maxlines=(\d+)/i) { $MAXLINE=&DecodeEncodedString("$1"); }
        else { $MAXLINE=5000; }
index bc92925e3c5c0e82db5765e40b40c1eec76b482d..e9abb1b25481ffd46f02756490a0ff69743da2b3 100644 (file)
@@ -45,7 +45,7 @@ sub Init_tooltips {
 
        # <-----
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
-       debug(" InitParams=$InitParams",1);
+       debug(" Plugin tooltips: InitParams=$InitParams",1);
        $TOOLTIPON=1;
        $TOOLTIPWIDTH=380;                                      # Width of tooltips
        # ----->
@@ -180,7 +180,7 @@ sub _ReadAndOutputTooltipFile {
                        if (open(LANG,"${searchdir}tooltips_${logtype}/awstats-tt-en.txt")) { $FileLang="${searchdir}tooltips_${logtype}/awstats-tt-en.txt"; last; }
                }
        }
-       if ($Debug) { debug("Call to Read_Language_Tooltip [FileLang=\"$FileLang\"]"); }
+       if ($Debug) { debug(" Plugin tooltips: Call to Read_Language_Tooltip [FileLang=\"$FileLang\"]"); }
        if ($FileLang) {
                my $aws_PROG=ucfirst($PROG);
                my $aws_VisitTimeout = $VISITTIMEOUT/10000*60;
index ae7467d07dedb351828127a747454af9be40baa7..55fd11b35fda6bbda4ddc47dd0ab2436280803cb 100644 (file)
@@ -50,7 +50,7 @@ sub Init_urlalias {
 
        # <-----
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
-       debug(" InitParams=$InitParams",1);
+       debug(" Plugin urlalias: InitParams=$InitParams",1);
        $urlinfoloaded=0;
        %UrlAlias=();
        @UrlMatch=();
@@ -94,8 +94,8 @@ sub ShowInfoURL_urlalias {
                }
                close URLALIASFILE;
                close URLMATCHFILE;
-               debug("UrlAlias file loaded: ".(scalar keys %UrlAlias)." entries found.");
-               debug("UrlMatch file loaded: ".(scalar @UrlMatch)." entries found.");
+               debug(" Plugin urlalias: UrlAlias file loaded: ".(scalar keys %UrlAlias)." entries found.");
+               debug(" Plugin urlalias: UrlMatch file loaded: ".(scalar @UrlMatch)." entries found.");
                $urlinfoloaded=1;
        }
        if ($param) {
index a7d1e5b8ca6824580e6ca219d75541dfff7f0bec..208f0b818df5067fd84c36a167f7c404a219cac4 100644 (file)
@@ -50,7 +50,7 @@ sub Init_userinfo {
 
        # <-----
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
-       debug(" InitParams=$InitParams",1);
+       debug(" Plugin userinfo: InitParams=$InitParams",1);
        $userinfoloaded=0;
        %UserInfo=();
        # ----->
@@ -81,7 +81,7 @@ sub ShowInfoUser_userinfo {
                # This is the fastest way to load with regexp that I know
                %UserInfo = map(/^([^\t]+)\t+([^\t]+)/o,<USERINFOFILE>);
                close USERINFOFILE;
-               debug("UserInfo file loaded: ".(scalar keys %UserInfo)." entries found.");
+               debug(" Plugin userinfo: UserInfo file loaded: ".(scalar keys %UserInfo)." entries found.");
                $userinfoloaded=1;
        }
        if ($param eq '__title__') {