Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use Msg logger in Java examples.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 6 Oct 2017 21:14:30 +0000 (23:14 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 9 Oct 2017 19:14:47 +0000 (21:14 +0200)
examples/java/app/pingpong/Main.java
examples/java/cloud/masterworker/Main.java
examples/java/cloud/migration/Daemon.java
examples/java/cloud/migration/XVM.java
examples/java/process/kill/Main.java
examples/java/process/suspend/Main.java

index 8e56aed..2030da9 100644 (file)
@@ -25,8 +25,8 @@ class Main {
     
     File f = new File(platfFile); 
     if (!f.exists()) {
-       System.err.println("File "+platfFile+" does not exist in "+System.getProperty("user.dir"));
-       System.err.println("Usage  : Main ../platforms/platform.xml");
+      Msg.error("File " + platfFile + " does not exist in " + System.getProperty("user.dir"));
+      Msg.error("Usage  : Main ../platforms/platform.xml");
     }
     
     Msg.createEnvironment(platfFile);
index a99dc21..5623ffa 100644 (file)
@@ -29,8 +29,8 @@ class Main {
     
     File f = new File(platfFile); 
     if (!f.exists()) {
-       System.err.println("File "+platfFile+" does not exist in "+System.getProperty("user.dir"));
-       System.err.println("Usage  : Main ../platforms/platform.xml");
+      Msg.error("File " + platfFile + " does not exist in " + System.getProperty("user.dir"));
+      Msg.error("Usage  : Main ../platforms/platform.xml");
     }
     
     Msg.createEnvironment(platfFile);
index d3c2af2..6e1bae9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@ public class Daemon extends Process {
     } catch (HostFailureException e) {
       e.printStackTrace();
     } catch (TaskCancelledException e) {
-      System.out.println("task cancelled");
+      Msg.info("task cancelled");
       suspend(); // Suspend the process
     }
     currentTask = new Task(this.getHost().getName()+"-daemon-"+(i++), this.getHost().getSpeed()*100, 0);
index 414c980..10407a6 100644 (file)
@@ -47,7 +47,7 @@ public class XVM extends VM {
   }
 
   public int getLoad(){
-    System.out.println("Remaining comp:" + this.daemon.getRemaining());
+    Msg.info("Remaining comp:" + this.daemon.getRemaining());
     return this.currentLoad;
   }
 
index 71d281b..96cf864 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2014. The SimGrid Team.
+/* Copyright (c) 2006-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@ public class Main {
       Killer killer = new Killer("Jacquelin","killer");
       killer.start();
     } catch (MsgException e){
-      System.out.println("Create processes failed!");
+      Msg.error("Create processes failed!");
     }
 
     /*  execute the simulation. */
index 04510e8..3eb4064 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2006-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@ public class Main {
     try {
         DreamMaster process1 = new DreamMaster("Jacquelin","DreamMaster");
         process1.start();
-      } catch (MsgException e){
-        System.out.println("Create processes failed!");
-      }
+    } catch (MsgException e){
+      Msg.error("Create processes failed!");
+    }
 
     /*  execute the simulation. */
     Msg.run();