Skip to content
Snippets Groups Projects
Commit e2f4d7e4 authored by Tom Fischer's avatar Tom Fischer
Browse files

Using logog logging within classes Station and StationBorehole.

parent 60306176
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
#include <cstdlib> #include <cstdlib>
#include <fstream> #include <fstream>
#include <iomanip> #include <iomanip>
// Base
// ThirdParty/logog
#include "logog/include/logog.hpp"
// BaseLib
#include "DateTools.h" #include "DateTools.h"
#include "StringTools.h" #include "StringTools.h"
// GeoLib // GeoLib
...@@ -79,7 +83,7 @@ Station* Station::createStation(const std::string & line) ...@@ -79,7 +83,7 @@ Station* Station::createStation(const std::string & line)
} }
else else
{ {
std::cout << "Station::createStation() - Unexpected file format..." << std::endl; INFO("Station::createStation() - Unexpected file format.");
delete station; delete station;
return NULL; return NULL;
} }
...@@ -168,8 +172,7 @@ int StationBorehole::readStratigraphyFile(const std::string &path, ...@@ -168,8 +172,7 @@ int StationBorehole::readStratigraphyFile(const std::string &path,
if (!in.is_open()) if (!in.is_open())
{ {
std::cout << "StationBorehole::readStratigraphyFile() - Could not open file..." << WARN("StationBorehole::readStratigraphyFile() - Could not open file %s.", path.c_str());
std::endl;
return 0; return 0;
} }
...@@ -195,7 +198,7 @@ int StationBorehole::addStratigraphy(const std::string &path, StationBorehole* b ...@@ -195,7 +198,7 @@ int StationBorehole::addStratigraphy(const std::string &path, StationBorehole* b
// check if a layer is missing // check if a layer is missing
size = borehole->_soilName.size(); size = borehole->_soilName.size();
std::cout << "StationBorehole::addStratigraphy ToDo" << std::endl; INFO("StationBorehole::addStratigraphy ToDo");
// for (size_t i=0; i<size; i++) // for (size_t i=0; i<size; i++)
// { // {
// if ((borehole->_soilLayerThickness[i] == -1) ||(borehole->_soilName[i].compare("") == 0)) // if ((borehole->_soilLayerThickness[i] == -1) ||(borehole->_soilName[i].compare("") == 0))
...@@ -203,7 +206,7 @@ int StationBorehole::addStratigraphy(const std::string &path, StationBorehole* b ...@@ -203,7 +206,7 @@ int StationBorehole::addStratigraphy(const std::string &path, StationBorehole* b
// borehole->_soilLayerThickness.clear(); // borehole->_soilLayerThickness.clear();
// borehole->_soilName.clear(); // borehole->_soilName.clear();
// //
// cout << "StationBorehole::addStratigraphy() - Profile incomplete (Borehole " << borehole->_name << ", Layer " << (i+1) << " missing).\n"; // WARN("StationBorehole::addStratigraphy() - Profile incomplete (Borehole %s, Layer %d missing)", borehole->_name.c_str(), i+1);
// //
// return 0; // return 0;
// } // }
...@@ -226,8 +229,7 @@ int StationBorehole::addLayer(std::list<std::string> fields, StationBorehole* bo ...@@ -226,8 +229,7 @@ int StationBorehole::addLayer(std::list<std::string> fields, StationBorehole* bo
// int layer = atoi(fields.front().c_str()); // int layer = atoi(fields.front().c_str());
fields.pop_front(); fields.pop_front();
std::cerr << "StationBorehole::addLayer - assuming correct order" << ERR("StationBorehole::addLayer - assuming correct order");
std::endl;
double thickness(strtod(BaseLib::replaceString(",", ".", fields.front()).c_str(), 0)); double thickness(strtod(BaseLib::replaceString(",", ".", fields.front()).c_str(), 0));
fields.pop_front(); fields.pop_front();
borehole->addSoilLayer(thickness, fields.front()); borehole->addSoilLayer(thickness, fields.front());
...@@ -235,9 +237,7 @@ int StationBorehole::addLayer(std::list<std::string> fields, StationBorehole* bo ...@@ -235,9 +237,7 @@ int StationBorehole::addLayer(std::list<std::string> fields, StationBorehole* bo
} }
else else
{ {
std::cout WARN("StationBorehole::addLayer() - Unexpected file format (Borehole %s).", borehole->_name.c_str());
<< "StationBorehole::addLayer() - Unexpected file format (Borehole "
<< borehole->_name << ")..." << std::endl;
return 0; return 0;
} }
return 1; return 1;
...@@ -257,7 +257,7 @@ int StationBorehole::addStratigraphy(const std::vector<Point*> &profile, const s ...@@ -257,7 +257,7 @@ int StationBorehole::addStratigraphy(const std::vector<Point*> &profile, const s
return 1; return 1;
} }
std::cout << "Error in StationBorehole::addStratigraphy() - Length of parameter vectors does not match." << std::endl; ERR("Error in StationBorehole::addStratigraphy() - Length of parameter vectors does not match.");
return 0; return 0;
} }
...@@ -295,9 +295,7 @@ int StationBorehole::addStratigraphies(const std::string &path, std::vector<Poin ...@@ -295,9 +295,7 @@ int StationBorehole::addStratigraphies(const std::string &path, std::vector<Poin
soil_name); soil_name);
} }
else else
std::cout << ERR("Error in StationBorehole::addStratigraphies() - Unexpected file format.");
"StationBorehole::addStratigraphies() - Unexpected file format..."
<< std::endl;
//return 0; //return 0;
} }
} }
...@@ -334,7 +332,7 @@ StationBorehole* StationBorehole::createStation(const std::string &line) ...@@ -334,7 +332,7 @@ StationBorehole* StationBorehole::createStation(const std::string &line)
} }
else else
{ {
std::cout << "Station::createStation() - Unexpected file format..." << std::endl; WARN("Station::createStation() - Unexpected file format.");
delete borehole; delete borehole;
return NULL; return NULL;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment