2003-06-28 22:50:33 +02:00
|
|
|
#!@@@perl@@@ -wT
|
2003-06-13 04:11:16 +02:00
|
|
|
use strict;
|
|
|
|
use POSIX;
|
2003-08-23 17:44:14 +02:00
|
|
|
use Time::HiRes qw(gettimeofday);
|
|
|
|
my $use_microseconds;
|
|
|
|
if ($ARGV[0] eq '-u') {
|
|
|
|
$use_microseconds = 1;
|
|
|
|
shift;
|
|
|
|
}
|
2003-06-13 04:11:16 +02:00
|
|
|
while (<>) {
|
|
|
|
chomp;
|
2003-08-23 17:44:14 +02:00
|
|
|
my ($seconds, $microseconds) = gettimeofday;
|
|
|
|
my $now = strftime('%Y-%m-%dT%H:%M:%S', localtime($seconds));
|
|
|
|
if ($use_microseconds) {
|
|
|
|
printf "%s.%06d %s\n", $now, $microseconds, $_;
|
|
|
|
} else {
|
|
|
|
print "$now $_\n";
|
|
|
|
}
|
2003-06-13 04:11:16 +02:00
|
|
|
}
|