Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] [sympa-commits] sympa[8082] branches/sympa-6.2-branch/src/lib/Log.pm: [feature] Log::do_log (): Truncate long strings.

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: David Verdin <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] [sympa-commits] sympa[8082] branches/sympa-6.2-branch/src/lib/Log.pm: [feature] Log::do_log (): Truncate long strings.
  • Date: Tue, 04 Dec 2012 16:13:16 +0100

Hi Soji,

I'm not sure about this. Why should we limit the logs length?
Sometimes, we will have long data to log and logs will be useless without them.

Cheers,

David

Le 04/12/12 06:58, address@concealed a écrit :
sympa[8082] branches/sympa-6.2-branch/src/lib/Log.pm: [feature] Log::do_log(): Truncate long strings.
Revision
8082
Author
sikeda
Date
2012-12-04 06:58:53 +0100 (mar. 04 déc. 2012)

Log Message

[feature] Log::do_log(): Truncate long strings.

Modified Paths

  • branches/sympa-6.2-branch/src/lib/Log.pm

Diff

Modified: branches/sympa-6.2-branch/src/lib/Log.pm (8081 => 8082)


--- branches/sympa-6.2-branch/src/lib/Log.pm	2012-12-04 05:44:18 UTC (rev 8081)
+++ branches/sympa-6.2-branch/src/lib/Log.pm	2012-12-04 05:58:53 UTC (rev 8082)
@@ -96,7 +96,7 @@
 	$level = 'info';
     }
 
-    # do not log if log level if too high regarding the log requested by user 
+    # do not log if log level is too high regarding the log requested by user 
     return if defined $log_level and $levels{$level} > $log_level;
     return if ! defined $log_level and $levels{$level} > 0;
 
@@ -121,11 +121,13 @@
 		push @param, sprintf('%s <%s>', ref $p, $p->get_id);
 	    } else {
 		push @param, ref $p;
-	}
+	    }
+	} elsif (length $p > 100) {
+	    push @param, substr($p, 0, 86) . '...(truncated)';
 	} else {
 	    push @param, $p;
+	}
     }
-    }
 
     ## Determine calling function
     my $caller_string;

Attachment: smime.p7s
Description: Signature cryptographique S/MIME




Archive powered by MHonArc 2.6.19+.

Top of Page