From fd85e36ca37c93139dc7bf8d06cf71bc5a225321 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Sun, 24 May 2015 14:26:24 +0200 Subject: [PATCH] add logging to the Guile module --- src/bindings/Guile.cxx | 6 +++++- src/bindings/Guile.hxx | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bindings/Guile.cxx b/src/bindings/Guile.cxx index 78ad380..356757d 100644 --- a/src/bindings/Guile.cxx +++ b/src/bindings/Guile.cxx @@ -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; } diff --git a/src/bindings/Guile.hxx b/src/bindings/Guile.hxx index d67a0dd..942b04f 100644 --- a/src/bindings/Guile.hxx +++ b/src/bindings/Guile.hxx @@ -2,6 +2,7 @@ #define INCLUDE__Guile_hxx_ #include +#include #include "Interpreter.hxx" @@ -26,6 +27,7 @@ public: private: SCM guile_output_port; SCM guile_error_port; + log4cxx::LoggerPtr logger; }; #endif /* INCLUDE__Guile_hxx_ */ -- 2.39.5