commit c512ec899a991388d4409831b27d41e9bed26159
parent 3cc2401e79e0f6503e5415e71f108cde6ecb430d
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Fri, 24 Oct 2014 01:56:09 -0600
logs: print time string when opening log
Diffstat:
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/gen_svg.pl b/gen_svg.pl
@@ -11,8 +11,6 @@ use shared;
my $log = get_log("pricechart_gen_svg");
-print $log strftime "%b %e %Y %H:%M ", localtime;
-
my $svg_dir = "$cfg->{general}{var}/www/htdocs/svg";
mkdir $svg_dir;
diff --git a/price_scraper.pl b/price_scraper.pl
@@ -9,7 +9,6 @@ use shared;
my $ua = get_ua();
-my $log = get_log("pricechart_scrapes");
my $part_num;
if ($args{p}) {
@@ -36,7 +35,7 @@ $dbh->do("create table if not exists prices(" .
"duration int, " .
"primary key(date, part_num, vendor, price))");
-print $log strftime "%b %e %Y %H:%M ", localtime;
+my $log = get_log("pricechart_scrapes");
printf $log "%-15s [", $part_num;
vprint("$part_num\n");
diff --git a/shared.pm b/shared.pm
@@ -84,6 +84,8 @@ sub get_log
make_dir($log_dir);
open my $log, ">>", "$log_dir/$file.txt";
+
+ print $log strftime "%b %e %Y %H:%M ", localtime;
return $log;
}