diff --git a/headers/modsecurity/debug_log.h b/headers/modsecurity/debug_log.h index c637eb55..20141699 100644 --- a/headers/modsecurity/debug_log.h +++ b/headers/modsecurity/debug_log.h @@ -28,6 +28,8 @@ typedef struct DebugLog_t DebugLog; #ifdef __cplusplus namespace modsecurity { +namespace debug_log { + /** @ingroup ModSecurity_CPP_API */ class DebugLog { @@ -51,6 +53,8 @@ class DebugLog { std::string m_fileName; }; + +} // namespace debug_log } // namespace modsecurity #endif diff --git a/headers/modsecurity/rules_properties.h b/headers/modsecurity/rules_properties.h index 4702ae12..e8fee266 100644 --- a/headers/modsecurity/rules_properties.h +++ b/headers/modsecurity/rules_properties.h @@ -45,6 +45,7 @@ namespace Parser { class Driver; } +using modsecurity::debug_log::DebugLog; /** @ingroup ModSecurity_CPP_API */ class ConfigInt { diff --git a/src/Makefile.am b/src/Makefile.am index 5164f5fb..e389832c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -247,8 +247,8 @@ libmodsecurity_la_SOURCES = \ audit_log/writer/parallel.cc \ modsecurity.cc \ rules.cc \ - debug_log.cc \ - debug_log_writer.cc \ + debug_log/debug_log.cc \ + debug_log/debug_log_writer.cc \ macro_expansion.cc \ rule.cc \ rule_message.cc \ diff --git a/src/debug_log.cc b/src/debug_log/debug_log.cc similarity index 94% rename from src/debug_log.cc rename to src/debug_log/debug_log.cc index ac240bf0..6bb1e3f4 100644 --- a/src/debug_log.cc +++ b/src/debug_log/debug_log.cc @@ -19,11 +19,13 @@ #include -#include "src/debug_log_writer.h" +#include "src/debug_log/debug_log_writer.h" #include "src/debug_log_writer_agent.h" namespace modsecurity { +namespace debug_log { + DebugLog::~DebugLog() { DebugLogWriter::getInstance().close(m_fileName); @@ -79,4 +81,5 @@ void DebugLog::write(int level, const std::string &msg) { } +} // namespace debug_log } // namespace modsecurity diff --git a/src/debug_log_writer.cc b/src/debug_log/debug_log_writer.cc similarity index 98% rename from src/debug_log_writer.cc rename to src/debug_log/debug_log_writer.cc index 9c89f7d7..5ddf8c44 100644 --- a/src/debug_log_writer.cc +++ b/src/debug_log/debug_log_writer.cc @@ -13,7 +13,7 @@ * */ -#include "src/debug_log_writer.h" +#include "src/debug_log/debug_log_writer.h" #include #include @@ -28,7 +28,7 @@ #include namespace modsecurity { - +namespace debug_log { debug_log_file_handler_t *DebugLogWriter::find_handler( const std::string &fileName) { @@ -240,4 +240,5 @@ void DebugLogWriter::write_log(const std::string& fileName, } +} // namespace debug_log } // namespace modsecurity diff --git a/src/debug_log_writer.h b/src/debug_log/debug_log_writer.h similarity index 91% rename from src/debug_log_writer.h rename to src/debug_log/debug_log_writer.h index 73993eb1..ed8b0cda 100644 --- a/src/debug_log_writer.h +++ b/src/debug_log/debug_log_writer.h @@ -24,11 +24,12 @@ #include -#ifndef SRC_DEBUG_LOG_WRITER_H_ -#define SRC_DEBUG_LOG_WRITER_H_ +#ifndef SRC_DEBUG_LOG_DEBUG_LOG_WRITER_H_ +#define SRC_DEBUG_LOG_DEBUG_LOG_WRITER_H_ namespace modsecurity { +namespace debug_log { typedef struct debug_log_file_handler { @@ -77,6 +78,7 @@ class DebugLogWriter { }; +} // namespace debug_log } // namespace modsecurity -#endif // SRC_DEBUG_LOG_WRITER_H_ +#endif // SRC_DEBUG_LOG_DEBUG_LOG_WRITER_H_ diff --git a/test/regression/custom_debug_log.h b/test/regression/custom_debug_log.h index 1544e7cc..a3ff4b79 100644 --- a/test/regression/custom_debug_log.h +++ b/test/regression/custom_debug_log.h @@ -23,7 +23,7 @@ namespace modsecurity_test { -class CustomDebugLog : public modsecurity::DebugLog { +class CustomDebugLog : public modsecurity::debug_log::DebugLog { public: CustomDebugLog *new_instance(); ~CustomDebugLog();