diff options
author | David Phillips <david@sighup.nz> | 2017-10-02 00:48:26 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-10-02 01:09:45 +1300 |
commit | 8bc6d6e2f50c2986d2e431af9a994af687f27a40 (patch) | |
tree | 9b3ea57e7a6ba668b9ab3bcea0fd375fca457923 /plugin | |
parent | ebad7de34ff7ae2cd5cbf883e843942e1190c1f7 (diff) | |
download | idalius-8bc6d6e2f50c2986d2e431af9a994af687f27a40.tar.xz |
Change from print to log, add timestamp
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/tittilate.pm | 2 | ||||
-rw-r--r-- | plugin/url_title.pm | 6 |
2 files changed, 4 insertions, 4 deletions
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; } |