Moves debuglog stuff inside the debug_log namespace

This commit is contained in:
Felipe Zimmerle 2016-12-09 09:52:01 -03:00
parent a3787fedb8
commit 64e2927922
7 changed files with 20 additions and 9 deletions

View File

@ -28,6 +28,8 @@ typedef struct DebugLog_t DebugLog;
#ifdef __cplusplus #ifdef __cplusplus
namespace modsecurity { namespace modsecurity {
namespace debug_log {
/** @ingroup ModSecurity_CPP_API */ /** @ingroup ModSecurity_CPP_API */
class DebugLog { class DebugLog {
@ -51,6 +53,8 @@ class DebugLog {
std::string m_fileName; std::string m_fileName;
}; };
} // namespace debug_log
} // namespace modsecurity } // namespace modsecurity
#endif #endif

View File

@ -45,6 +45,7 @@ namespace Parser {
class Driver; class Driver;
} }
using modsecurity::debug_log::DebugLog;
/** @ingroup ModSecurity_CPP_API */ /** @ingroup ModSecurity_CPP_API */
class ConfigInt { class ConfigInt {

View File

@ -247,8 +247,8 @@ libmodsecurity_la_SOURCES = \
audit_log/writer/parallel.cc \ audit_log/writer/parallel.cc \
modsecurity.cc \ modsecurity.cc \
rules.cc \ rules.cc \
debug_log.cc \ debug_log/debug_log.cc \
debug_log_writer.cc \ debug_log/debug_log_writer.cc \
macro_expansion.cc \ macro_expansion.cc \
rule.cc \ rule.cc \
rule_message.cc \ rule_message.cc \

View File

@ -19,11 +19,13 @@
#include <fstream> #include <fstream>
#include "src/debug_log_writer.h" #include "src/debug_log/debug_log_writer.h"
#include "src/debug_log_writer_agent.h" #include "src/debug_log_writer_agent.h"
namespace modsecurity { namespace modsecurity {
namespace debug_log {
DebugLog::~DebugLog() { DebugLog::~DebugLog() {
DebugLogWriter::getInstance().close(m_fileName); DebugLogWriter::getInstance().close(m_fileName);
@ -79,4 +81,5 @@ void DebugLog::write(int level, const std::string &msg) {
} }
} // namespace debug_log
} // namespace modsecurity } // namespace modsecurity

View File

@ -13,7 +13,7 @@
* *
*/ */
#include "src/debug_log_writer.h" #include "src/debug_log/debug_log_writer.h"
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
@ -28,7 +28,7 @@
#include <fstream> #include <fstream>
namespace modsecurity { namespace modsecurity {
namespace debug_log {
debug_log_file_handler_t *DebugLogWriter::find_handler( debug_log_file_handler_t *DebugLogWriter::find_handler(
const std::string &fileName) { const std::string &fileName) {
@ -240,4 +240,5 @@ void DebugLogWriter::write_log(const std::string& fileName,
} }
} // namespace debug_log
} // namespace modsecurity } // namespace modsecurity

View File

@ -24,11 +24,12 @@
#include <cstring> #include <cstring>
#ifndef SRC_DEBUG_LOG_WRITER_H_ #ifndef SRC_DEBUG_LOG_DEBUG_LOG_WRITER_H_
#define SRC_DEBUG_LOG_WRITER_H_ #define SRC_DEBUG_LOG_DEBUG_LOG_WRITER_H_
namespace modsecurity { namespace modsecurity {
namespace debug_log {
typedef struct debug_log_file_handler { typedef struct debug_log_file_handler {
@ -77,6 +78,7 @@ class DebugLogWriter {
}; };
} // namespace debug_log
} // namespace modsecurity } // namespace modsecurity
#endif // SRC_DEBUG_LOG_WRITER_H_ #endif // SRC_DEBUG_LOG_DEBUG_LOG_WRITER_H_

View File

@ -23,7 +23,7 @@
namespace modsecurity_test { namespace modsecurity_test {
class CustomDebugLog : public modsecurity::DebugLog { class CustomDebugLog : public modsecurity::debug_log::DebugLog {
public: public:
CustomDebugLog *new_instance(); CustomDebugLog *new_instance();
~CustomDebugLog(); ~CustomDebugLog();