diff --git a/hecl/driver/ToolBase.hpp b/hecl/driver/ToolBase.hpp index bdee10338..bf1b6b3fd 100644 --- a/hecl/driver/ToolBase.hpp +++ b/hecl/driver/ToolBase.hpp @@ -9,6 +9,9 @@ #include #include "HECL/Database.hpp" +#include "LogVisor/LogVisor.hpp" + +extern LogVisor::LogModule LogModule; struct ToolPassInfo { @@ -71,7 +74,10 @@ private: ++it; } if (counter == WRAP_INDENT) - it = string.insert(it, WRAP_INDENT, _S(' ')) + WRAP_INDENT; + { + string.insert(it, WRAP_INDENT, _S(' ')); + it += WRAP_INDENT; + } if (it >= string.end()) return; if (*it != _S('\n')) diff --git a/hecl/driver/ToolInit.hpp b/hecl/driver/ToolInit.hpp index 6e87dd4ab..db0fd7b45 100644 --- a/hecl/driver/ToolInit.hpp +++ b/hecl/driver/ToolInit.hpp @@ -50,10 +50,10 @@ public: } catch (HECL::Exception& e) { - HECL::FPrintf(stderr, _S("unable to init project: '%s'\n"), e.swhat()); + LogModule.report(LogVisor::Error, _S("unable to init project: '%s'\n"), e.swhat()); return -1; } - HECL::Printf(_S("initialized project at '%s/.hecl'\n"), m_dir->c_str()); + LogModule.report(LogVisor::Info, _S("initialized project at '%s/.hecl'\n"), m_dir->c_str()); return 0; } diff --git a/hecl/driver/driver.pro b/hecl/driver/driver.pro index 2b526fa7f..010b7421d 100644 --- a/hecl/driver/driver.pro +++ b/hecl/driver/driver.pro @@ -1,13 +1,14 @@ +TEMPLATE = app TARGET = hecl CONFIG -= Qt +CONFIG += c++11 QT = LIBS -= -lQtGui -lQtCore -unix:QMAKE_CXXFLAGS += -std=c++11 -unix:LIBS += -std=c++11 -clang:QMAKE_CXXFLAGS += -stdlib=libc++ -clang:LIBS += -stdlib=libc++ -lc++abi -INCLUDEPATH += ../include ../extern/Athena/include ../extern +INCLUDEPATH += ../include \ + ../extern/Athena/include \ + ../extern/LogVisor/include \ + ../extern LIBPATH += $$OUT_PWD/../lib \ $$OUT_PWD/../blender \ diff --git a/hecl/driver/main.cpp b/hecl/driver/main.cpp index ab194daca..e23f4acf5 100644 --- a/hecl/driver/main.cpp +++ b/hecl/driver/main.cpp @@ -6,6 +6,9 @@ #include #include #include "HECL/Database.hpp" +#include "LogVisor/LogVisor.hpp" + +LogVisor::LogModule LogModule("HECLDriver"); #include "ToolBase.hpp" #include "ToolInit.hpp" @@ -21,6 +24,7 @@ bool XTERM_COLOR = false; + /* #define HECL_GIT 1234567 #define HECL_GIT_S "1234567" @@ -164,9 +168,9 @@ int main(int argc, const char** argv) } catch (HECL::Exception& ex) { - HECL::FPrintf(stderr, - _S("Unable to open discovered project at '%s':\n%s\n"), - rootPath->getAbsolutePath().c_str(), ex.swhat()); + LogModule.report(LogVisor::Error, + _S("Unable to open discovered project at '%s':\n%s\n"), + rootPath->getAbsolutePath().c_str(), ex.swhat()); return -1; } } @@ -202,14 +206,14 @@ int main(int argc, const char** argv) } catch (HECL::Exception& ex) { - HECL::FPrintf(stderr, - _S("Unable to construct HECL tool '%s':\n%s\n"), - toolName.c_str(), ex.swhat()); + LogModule.report(LogVisor::Error, _S("Unable to construct HECL tool '%s':\n%s\n"), + toolName.c_str(), ex.swhat()); return -1; } if (info.verbosityLevel) - HECL::Printf(_S("Constructed tool '%s' %d\n"), tool->toolName().c_str(), info.verbosityLevel); + LogModule.report(LogVisor::Info, _S("Constructed tool '%s' %d\n"), + tool->toolName().c_str(), info.verbosityLevel); /* Run tool */ int retval; @@ -219,7 +223,8 @@ int main(int argc, const char** argv) } catch (HECL::Exception& ex) { - HECL::FPrintf(stderr, _S("Error running HECL tool '%s':\n%s\n"), toolName.c_str(), ex.swhat()); + LogModule.report(LogVisor::Error, _S("Error running HECL tool '%s':\n%s\n"), + toolName.c_str(), ex.swhat()); return -1; } diff --git a/hecl/lib/lib.pro b/hecl/lib/lib.pro index d16782154..c9c20fff8 100644 --- a/hecl/lib/lib.pro +++ b/hecl/lib/lib.pro @@ -3,11 +3,6 @@ CONFIG += staticlib c++11 TARGET = hecl CONFIG -= Qt QT = -unix:QMAKE_CXXFLAGS += -std=c++11 -unix:QMAKE_CFLAGS += -std=c99 -unix:LIBS += -std=c++11 -clang:QMAKE_CXXFLAGS += -stdlib=libc++ -clang:LIBS += -stdlib=libc++ -lc++abi INCLUDEPATH += $$PWD ../include ../extern ../extern/Athena/include