[cig-commits] [commit] master: Fix error output to correct location (b827e1e)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Oct 20 15:13:48 PDT 2014


Repository : https://github.com/geodynamics/vc

On branch  : master
Link       : https://github.com/geodynamics/vc/compare/e91e7f3a67d22391a31bcfa9ff881ef8097ad787...64c223c129f70f3916341f1ebdf52f6d2ae1deae

>---------------------------------------------------------------

commit b827e1ea5c1a13bf3959e1f02fc98370a63e8b94
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Mon Oct 20 14:17:45 2014 -0700

    Fix error output to correct location


>---------------------------------------------------------------

b827e1ea5c1a13bf3959e1f02fc98370a63e8b94
 src/io/EventOutput.cpp   | 6 +++---
 src/io/ReadModelFile.cpp | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/io/EventOutput.cpp b/src/io/EventOutput.cpp
index 61f428e..0163b1b 100644
--- a/src/io/EventOutput.cpp
+++ b/src/io/EventOutput.cpp
@@ -112,7 +112,7 @@ void EventOutput::init(SimFramework *_sim) {
 #ifdef HDF5_FOUND
             open_hdf5_file(sim->getEventOutfile(), sim->getYear(), sim->getSimDuration());
 #else
-            std::cerr << "ERROR: HDF5 library not linked, cannot use HDF5 output files." << std::endl;
+            sim->errConsole() << "ERROR: HDF5 library not linked, cannot use HDF5 output files." << std::endl;
             exit(-1);
 #endif
         } else if (sim->getEventOutfileType() == "text") {
@@ -120,14 +120,14 @@ void EventOutput::init(SimFramework *_sim) {
             sweep_outfile.open(sim->getSweepOutfile().c_str());
 
             if (!event_outfile.good() || !sweep_outfile.good()) {
-                std::cerr << "ERROR: Could not open output file " << sim->getEventOutfile() << std::endl;
+                sim->errConsole() << "ERROR: Could not open output file " << sim->getEventOutfile() << std::endl;
                 exit(-1);
             }
 
             quakelib::ModelEvent::write_ascii_header(event_outfile);
             quakelib::ModelSweeps::write_ascii_header(sweep_outfile);
         } else {
-            std::cerr << "ERROR: Unknown output file type " << sim->getEventOutfileType() << std::endl;
+            sim->errConsole() << "ERROR: Unknown output file type " << sim->getEventOutfileType() << std::endl;
             exit(-1);
         }
     }
diff --git a/src/io/ReadModelFile.cpp b/src/io/ReadModelFile.cpp
index d75d189..d262186 100644
--- a/src/io/ReadModelFile.cpp
+++ b/src/io/ReadModelFile.cpp
@@ -54,13 +54,13 @@ void ReadModelFile::init(SimFramework *_sim) {
     } else if (file_type == "hdf5") {
         err = world.read_file_hdf5(file_name);
     } else {
-        std::cerr << "ERROR: unknown file type " << file_type << std::endl;
+        sim->errConsole() << "ERROR: unknown file type " << file_type << std::endl;
         return;
     }
 
     // If there was an error then exit
     if (err) {
-        std::cerr << "ERROR: could not read file " << file_name << std::endl;
+        sim->errConsole() << "ERROR: could not read file " << file_name << std::endl;
         return;
     }
 



More information about the CIG-COMMITS mailing list