[Rt-commit] r13837 - in rt/3.8/trunk: sbin

sartak at bestpractical.com sartak at bestpractical.com
Mon Jul 7 14:54:44 EDT 2008


Author: sartak
Date: Mon Jul  7 14:54:42 2008
New Revision: 13837

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/sbin/rt-email-dashboards.in

Log:
 r63785 at onn:  sartak | 2008-07-07 14:52:51 -0400
 email-dashboards: Rename vverbose to debug


Modified: rt/3.8/trunk/sbin/rt-email-dashboards.in
==============================================================================
--- rt/3.8/trunk/sbin/rt-email-dashboards.in	(original)
+++ rt/3.8/trunk/sbin/rt-email-dashboards.in	Mon Jul  7 14:54:42 2008
@@ -103,7 +103,7 @@
 # Read in the options
 my %opts;
 GetOptions( \%opts,
-    "help", "dryrun", "verbose", "vverbose", "epoch=i", "all", "skip-acl"
+    "help", "dryrun", "verbose", "debug", "epoch=i", "all", "skip-acl"
 );
 
 if ($opts{'help'}) {
@@ -114,8 +114,8 @@
 }
 
 # helper functions
-sub verbose  { print loc(@_), "\n" if $opts{verbose} || $opts{vverbose}; 1 }
-sub vverbose { print loc(@_), "\n" if $opts{vverbose}; 1 }
+sub verbose  { print loc(@_), "\n" if $opts{verbose} || $opts{verbose}; 1 }
+sub debug    { print loc(@_), "\n" if $opts{debug}; 1 }
 sub error    { $RT::Logger->error(loc(@_)); verbose(@_); 1 }
 sub warning  { $RT::Logger->warning(loc(@_)); verbose(@_); 1 }
 
@@ -123,29 +123,29 @@
 verbose "Using time [_1]", scalar localtime($now);
 
 my $from = get_from();
-vverbose "Sending email from [_1]", $from;
+debug "Sending email from [_1]", $from;
 
 # look through each user for her subscriptions
 my $Users = RT::Users->new($RT::SystemUser);
 while (defined(my $user = $Users->Next)) {
     if ($user->PrincipalObj->Disabled) {
-        vverbose "Skipping over "
-               . $user->Name
-               . " due to having a disabled account.";
+        debug "Skipping over "
+            . $user->Name
+            . " due to having a disabled account.";
         next;
     }
 
     unless (email_of($user)) {
-        vverbose "Skipping over "
-               . $user->Name
-               . " due to lack of EmailAddress.";
+        debug "Skipping over "
+            . $user->Name
+            . " due to lack of EmailAddress.";
         next;
     }
 
     my ($hour, $dow, $dom) = hour_dow_dom_in($user->Timezone || RT->Config->Get('Timezone'));
     $hour .= ':00';
-    vverbose "Checking [_1]'s subscriptions: hour [_2], dow [_3], dom [_4]",
-             $user->Name, $hour, $dow, $dom;
+    debug "Checking [_1]'s subscriptions: hour [_2], dow [_3], dom [_4]",
+          $user->Name, $hour, $dow, $dom;
 
     my $currentuser = RT::CurrentUser->new;
     $currentuser->LoadByName($user->Name);
@@ -155,7 +155,7 @@
     for my $subscription ($user->Attributes->Named('Subscription')) {
 
         if (!$opts{all}) {
-            vverbose "Checking against subscription with frequency [_1], hour [_2], dow [_3], dom [_4]", $subscription->SubValue('Frequency'), $subscription->SubValue('Hour'), $subscription->SubValue('Dow'), $subscription->SubValue('Dom');
+            debug "Checking against subscription with frequency [_1], hour [_2], dow [_3], dom [_4]", $subscription->SubValue('Frequency'), $subscription->SubValue('Hour'), $subscription->SubValue('Dow'), $subscription->SubValue('Dom');
 
             next if $subscription->SubValue('Frequency') eq 'never';
 
@@ -244,7 +244,7 @@
         $contents =~ s/$_//g;
     }
 
-    vverbose "Got [_1] characters of output.", length $contents;
+    debug "Got [_1] characters of output.", length $contents;
 
     $contents = HTML::RewriteAttributes::Links->rewrite(
         $contents,
@@ -275,9 +275,9 @@
         Entity => $entity,
     );
 
-    vverbose "Done sending dashboard to [_1] <[_2]>",
-             $currentuser->Name, email_of($currentuser)
-                 and return if $ok;
+    debug "Done sending dashboard to [_1] <[_2]>",
+          $currentuser->Name, email_of($currentuser)
+              and return if $ok;
 
     error 'Failed to email dashboard to user [_1] <[_2]>',
           $currentuser->Name, email_of($currentuser);
@@ -354,7 +354,7 @@
 
     sub mason {
         unless ($mason) {
-            vverbose "Creating Mason object.";
+            debug "Creating Mason object.";
             $mason = HTML::Mason::Interp->new(
                 RT::Interface::Web::Handler->DefaultHandlerArgs,
                 out_method => \$outbuf,
@@ -436,7 +436,7 @@
         }
     }
 
-    vverbose("Running component '$uri'");
+    debug "Running component '[_1]'", $uri;
     $content = run_component($uri, %args);
 
     $uri =~ s{^(.*/)(.*?)$}{$1};
@@ -457,7 +457,7 @@
     $mimetype ||= 'application/octet-stream';
     $encoding ||= 'base64';
 
-    vverbose "Resource [_1]: length=[_2] filename='[_3]' mimetype='[_4]', encoding='[_5]'",
+    debug "Resource [_1]: length=[_2] filename='[_3]' mimetype='[_4]', encoding='[_5]'",
         $original_uri,
         length($content),
         $filename,
@@ -529,7 +529,7 @@
 Print out some tracing information (such as which dashboards are being
 generated and sent out)
 
-=item --vverbose
+=item --debug
 
 Print out more tracing information (such as each user and subscription that is
 being considered)


More information about the Rt-commit mailing list