add logging to the Guile module
authorChristoph Egger <christoph@anonymous.siccegge.de>
Sun, 24 May 2015 12:26:24 +0000 (14:26 +0200)
committerChristoph Egger <christoph@anonymous.siccegge.de>
Sun, 24 May 2015 12:26:24 +0000 (14:26 +0200)
src/bindings/Guile.cxx
src/bindings/Guile.hxx

index 78ad3805044600813dfaa2a3974a7eb1e66a871c..356757d095ccb7ffb6d4a7bc4575bf4a7e70b74a 100644 (file)
@@ -8,7 +8,8 @@ namespace {
        }
 }
 
-GuileInterpreter::GuileInterpreter() {
+GuileInterpreter::GuileInterpreter()
+       : logger(log4cxx::Logger::getLogger("bindings.Guile")) {
        scm_init_guile();
 
        scm_c_use_module("system repl server");
@@ -20,6 +21,7 @@ GuileInterpreter::GuileInterpreter() {
        guile_error_port = scm_open_output_string();
        scm_set_current_output_port(guile_output_port);
        scm_set_current_error_port(guile_error_port);
+       LOG4CXX_INFO(logger, "Initializing GUILE finished");
 }
 
 int GuileInterpreter::evaluate(const std::string& command,
@@ -52,6 +54,8 @@ int GuileInterpreter::loadFile(const std::string& filename,
                                std::ostream& stdout,
                                std::ostream& stderr,
                                std::string& result) {
+       LOG4CXX_INFO(logger, "Loading file \"" << filename << "\"");
        scm_c_primitive_load(filename.c_str());
+       LOG4CXX_INFO(logger, "Finished file \"" << filename << "\"");
        return 0;
 }
index d67a0ddf0ac55dcc0d64de6ff3df312210f55a39..942b04ff9ab00561f8c47dbdb4cad8946ca850f2 100644 (file)
@@ -2,6 +2,7 @@
 #define INCLUDE__Guile_hxx_
 
 #include <libguile.h>
+#include <log4cxx/logger.h>
 
 #include "Interpreter.hxx"
 
@@ -26,6 +27,7 @@ public:
 private:
        SCM guile_output_port;
        SCM guile_error_port;
+       log4cxx::LoggerPtr logger;
 };
 
 #endif /* INCLUDE__Guile_hxx_ */