iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject [25/31] incubator-iota git commit: Corrected Monitor.scala according to the comments
Date Tue, 29 Nov 2016 23:29:24 GMT
Corrected Monitor.scala according to the comments


Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/5b2c3760
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/5b2c3760
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/5b2c3760

Branch: refs/heads/master
Commit: 5b2c37608a96efcef4d25914958c3eab6fd4dc3e
Parents: 9142e65
Author: Shivansh <shiv4nsh@gmail.com>
Authored: Tue Nov 15 06:35:42 2016 +0530
Committer: Shivansh <shiv4nsh@gmail.com>
Committed: Tue Nov 15 06:35:42 2016 +0530

----------------------------------------------------------------------
 fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/5b2c3760/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
index 4e0c3a4..98fa3e8 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
@@ -57,7 +57,7 @@ protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging
{
       eventsStore.append(sender().path.toString,MonitorEvent(EVENTS.STOP, timestamp, info))
 
     case RESTART(reason, timestamp) =>
-      logInfo(sender().path.toString, EVENTS.RESTART, timestamp, "", reason)
+      logInfo(sender().path.toString, EVENTS.RESTART, timestamp, "", Option(reason))
       eventsStore.append(sender().path.toString,MonitorEvent(EVENTS.RESTART, timestamp, reason.getMessage))
 
     case TERMINATE(actorPath, timestamp, info) =>
@@ -75,7 +75,7 @@ protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging
{
       Monitor.simpleEvents.put(sender().path.toString, ('O',timestamp))
 
     case RESTART(reason, timestamp) =>
-      logInfo(sender().path.toString, EVENTS.RESTART, timestamp, "", reason)
+      logInfo(sender().path.toString, EVENTS.RESTART, timestamp, "", Option(reason))
       Monitor.simpleEvents.put(sender().path.toString, ('R',timestamp))
 
     case TERMINATE(actorPath, timestamp, info) =>
@@ -87,9 +87,9 @@ protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging
{
     case _ =>
   }
 
-  def logInfo(path:String, event:String, timestamp: Long, info:String, reason:Throwable =
null): Unit = {
-    if(Option(reason).isDefined){
-      log.error(reason, s"$event | $timestamp | $path | $info")
+  def logInfo(path: String, event: String, timestamp: Long, info: String, reason: Option[Throwable]
= null): Unit = {
+    if (reason.isDefined) {
+      log.error(reason.get, s"$event | $timestamp | $path | $info")
     }else{
       log.info(s"$event | $timestamp | $path | $info")
     }


Mime
View raw message