From 8bc6d6e2f50c2986d2e431af9a994af687f27a40 Mon Sep 17 00:00:00 2001
From: David Phillips <david@sighup.nz>
Date: Mon, 2 Oct 2017 00:48:26 +1300
Subject: Change from print to log, add timestamp

---
 plugin/tittilate.pm | 2 +-
 plugin/url_title.pm | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'plugin')

diff --git a/plugin/tittilate.pm b/plugin/tittilate.pm
index d9d8a49..51253ec 100644
--- a/plugin/tittilate.pm
+++ b/plugin/tittilate.pm
@@ -15,7 +15,7 @@ sub configure {
 }
 
 sub message {
-	my ($self, $me, $who, $where, $raw_what, $what) = @_;
+	my ($self, $logger, $me, $who, $where, $raw_what, $what) = @_;
 	my $gathered = "";
 	my @expressions = (keys %{$config{triggers}});
 	my $expression = join '|', @expressions;
diff --git a/plugin/url_title.pm b/plugin/url_title.pm
index f36ad6d..1c376df 100644
--- a/plugin/url_title.pm
+++ b/plugin/url_title.pm
@@ -18,7 +18,7 @@ sub configure {
 
 sub message
 {
-	my ($self, $me, $who, $where, $raw_what, $what) = @_;
+	my ($self, $logger, $me, $who, $where, $raw_what, $what) = @_;
 	my $url;
 
 	if ($what =~ /(https?:\/\/[^ ]+)/i) {
@@ -31,12 +31,12 @@ sub message
 	my $response = $http->get($url);
 
 	if (!$response->{success}) {
-		print "Something broke: $response->{reason}\n";
+		$logger->("Something broke: $response->{reason}");
 		return;
 	}
 
 	if (!($response->{headers}->{"content-type"} =~ m,text/html ?,)) {
-		print("Not html, giving up now\n");
+		$logger->("Not html, giving up now");
 		return;
 	}
 
-- 
cgit v1.1