]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use names for logging parameters, and correct values
authorAlan T. DeKok <aland@freeradius.org>
Wed, 22 Feb 2012 08:25:18 +0000 (09:25 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 22 Feb 2012 08:26:16 +0000 (09:26 +0100)
src/modules/rlm_perl/example.pl

index 2371bd9bc439731deeb85f7993d0f888a010529f..f4cf13fe4daade7026ef9c82b844bbc902057d92 100644 (file)
@@ -58,6 +58,14 @@ use constant {
        RLM_MODULE_NUMCODES     => 9  # How many return codes there are
 };
 
+# Same as src/include/radiusd.h
+use constant   L_DBG=>   1;
+use constant   L_AUTH=>  2;
+use constant   L_INFO=>  3;
+use constant   L_ERR=>   4;
+use constant   L_PROXY=> 5;
+use constant   L_ACCT=>  6;
+
 #  Global variables can persist across different calls to the module.
 #
 #
@@ -157,8 +165,8 @@ sub xlat {
 
        # Loads some external perl and evaluate it
        my ($filename,$a,$b,$c,$d) = @_;
-       &radiusd::radlog(1, "From xlat $filename ");
-       &radiusd::radlog(1,"From xlat $a $b $c $d ");
+       &radiusd::radlog(L_DBG, "From xlat $filename ");
+       &radiusd::radlog(L_DBG,"From xlat $a $b $c $d ");
        local *FH;
        open FH, $filename or die "open '$filename' $!";
        local($/) = undef;
@@ -175,7 +183,7 @@ sub detach {
 #      &log_request_attributes;
 
        # Do some logging.
-       &radiusd::radlog(0,"rlm_perl::Detaching. Reloading. Done.");
+       &radiusd::radlog(L_DBG,"rlm_perl::Detaching. Reloading. Done.");
 }
 
 #
@@ -190,7 +198,7 @@ sub log_request_attributes {
        # This shouldn't be done in production environments!
        # This is only meant for debugging!
        for (keys %RAD_REQUEST) {
-               &radiusd::radlog(1, "RAD_REQUEST: $_ = $RAD_REQUEST{$_}");
+               &radiusd::radlog(L_DBG, "RAD_REQUEST: $_ = $RAD_REQUEST{$_}");
        }
 }