From: Arnaud Giersch Date: Fri, 6 Oct 2017 21:14:30 +0000 (+0200) Subject: Use Msg logger in Java examples. X-Git-Tag: v3.18~509^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4df391e5522f723e90b02164e5329eacd4dd1992 Use Msg logger in Java examples. --- diff --git a/examples/java/app/pingpong/Main.java b/examples/java/app/pingpong/Main.java index 8e56aed06d..2030da984b 100644 --- a/examples/java/app/pingpong/Main.java +++ b/examples/java/app/pingpong/Main.java @@ -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); diff --git a/examples/java/cloud/masterworker/Main.java b/examples/java/cloud/masterworker/Main.java index a99dc21ab7..5623ffa5e2 100644 --- a/examples/java/cloud/masterworker/Main.java +++ b/examples/java/cloud/masterworker/Main.java @@ -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); diff --git a/examples/java/cloud/migration/Daemon.java b/examples/java/cloud/migration/Daemon.java index d3c2af2001..6e1bae981b 100644 --- a/examples/java/cloud/migration/Daemon.java +++ b/examples/java/cloud/migration/Daemon.java @@ -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); diff --git a/examples/java/cloud/migration/XVM.java b/examples/java/cloud/migration/XVM.java index 414c98096e..10407a6f36 100644 --- a/examples/java/cloud/migration/XVM.java +++ b/examples/java/cloud/migration/XVM.java @@ -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; } diff --git a/examples/java/process/kill/Main.java b/examples/java/process/kill/Main.java index 71d281baf3..96cf864d3f 100644 --- a/examples/java/process/kill/Main.java +++ b/examples/java/process/kill/Main.java @@ -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. */ diff --git a/examples/java/process/suspend/Main.java b/examples/java/process/suspend/Main.java index 04510e852d..3eb40645c7 100644 --- a/examples/java/process/suspend/Main.java +++ b/examples/java/process/suspend/Main.java @@ -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();