/** * Gets the output stream. * * @return the output */ public static OutputStream getOutput() { if (output == null) { setOutput(System.out); } return output; }
Log.setOutput(new FileOutputStream(file));
+ getExperimentName(workload, vmAllocationPolicy, vmSelectionPolicy, parameter) + ".txt"); file.createNewFile(); Log.setOutput(new FileOutputStream(file));
/** * Runs all simulations of a specific environment. * It creates all CloudSim entities, runs the simulation and generates the * report. This cycle is repeated the number of times indicated by the * NumberOfSimulations setting. * * @since 1.0 */ private void runAllSimulations() { RemovePreviousReports(); isMailNotificationEnabled = SettingBusiness.isMailNotificationEnabled(); int numberOfSimulations = SettingBusiness.getNumberOfSimulations(); for (int simulationId = 1; simulationId <= numberOfSimulations; simulationId++) { SettingBusiness.setCurrentSimulation(simulationId); MainView.getSimulationView().setBarLabel("Simulation " + simulationId + " of " + HibernateUtil.getActiveDatabase() + " is in progress..."); Log.setOutput(LogIO.getFileOutputStream()); Log.printLine("CloudReports version 1.1"); Log.print("Verifying available resources..."); ResetCustomersTimeToSend(); if (Verification.verifyVMsDeploymentViability()) { runSimulation(simulationId); } else { Dialog.showErrorMessage(null, "Simulation aborted:\nSome of the virtual machines cannot be deployed by any available host."); MainView.getSimulationView().dispose(); break; } LogIO.removeTempLogFile(); } }