OSDN Git Service

eventd: more verbose error and info message
authorhylom <hylom@users.sourceforge.jp>
Thu, 7 Mar 2019 12:38:12 +0000 (21:38 +0900)
committerhylom <hylom@users.sourceforge.jp>
Thu, 7 Mar 2019 12:38:12 +0000 (21:38 +0900)
src/newslash_web/lib/Newslash/Eventd.pm
src/newslash_web/lib/Newslash/Eventd/Daemon.pm

index 81023d2..7220c76 100644 (file)
@@ -31,7 +31,7 @@ sub startup {
     if ($eventd_conf->{log_level}) {
         if ($eventd_conf->{log_level} =~ m/^(debug|info|warn|error|fatal)$/) {
             $app->log->level($eventd_conf->{log_level});
-            $app->log->debug("Eventd::startup: set log_level to '$eventd_conf->{log_level}'");
+            $app->log->info("Eventd::startup: set log_level to '$eventd_conf->{log_level}'");
         }
         else {
             $app->log->error("Eventd::startup: invalid log_level ($eventd_conf->{log_level})");
index e49ee95..6b47aec 100644 (file)
@@ -16,6 +16,10 @@ sub fetch_event_que {
 
     my $events = $app->model('events');
     my $rs = eval { $events->fetch(10) };
+    if ($@) {
+        $app->log->error("Eventd::Daemon::fetch_event_que: fetch event error. message(s):");
+        $app->log->error($@);
+    }
     if (!$rs) {
         $app->log->fatal("event fetch failed!");
     }