Move logging code to zeek namespaces

This commit is contained in:
Tim Wojtulewicz 2020-08-01 10:48:05 -07:00
parent 9a800265ff
commit 45b5c6e619
25 changed files with 135 additions and 114 deletions

View file

@ -5,14 +5,13 @@
#include "SQLite.h"
namespace plugin {
namespace Zeek_SQLiteWriter {
namespace zeek::plugin::Zeek_SQLiteWriter {
class Plugin : public zeek::plugin::Plugin {
public:
zeek::plugin::Configuration Configure() override
{
AddComponent(new ::logging::Component("SQLite", ::logging::writer::SQLite::Instantiate));
AddComponent(new zeek::logging::Component("SQLite", zeek::logging::writer::detail::SQLite::Instantiate));
zeek::plugin::Configuration config;
config.name = "Zeek::SQLiteWriter";
@ -21,5 +20,4 @@ public:
}
} plugin;
}
}
} // namespace zeek::plugin::Zeek_SQLiteWriter

View file

@ -12,13 +12,13 @@
#include "sqlite.bif.h"
using namespace std;
using namespace logging;
using namespace writer;
using threading::Value;
using threading::Field;
SQLite::SQLite(WriterFrontend* frontend)
: WriterBackend(frontend),
namespace zeek::logging::writer::detail {
SQLite::SQLite(zeek::logging::WriterFrontend* frontend)
: zeek::logging::WriterBackend(frontend),
fields(), num_fields(), db(), st()
{
set_separator.assign(
@ -112,7 +112,7 @@ bool SQLite::checkError(int code)
}
bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields,
const Field* const * arg_fields)
const Field* const * arg_fields)
{
if ( sqlite3_threadsafe() == 0 )
{
@ -365,3 +365,5 @@ bool SQLite::DoRotate(const char* rotated_path, double open, double close, bool
return true;
}
} // namespace zeek::logging::writer::detail

View file

@ -11,14 +11,14 @@
#include "3rdparty/sqlite3.h"
#include "Desc.h"
namespace logging { namespace writer {
namespace zeek::logging::writer::detail {
class SQLite : public WriterBackend {
class SQLite : public zeek::logging::WriterBackend {
public:
explicit SQLite(WriterFrontend* frontend);
explicit SQLite(zeek::logging::WriterFrontend* frontend);
~SQLite() override;
static WriterBackend* Instantiate(WriterFrontend* frontend)
static zeek::logging::WriterBackend* Instantiate(zeek::logging::WriterFrontend* frontend)
{ return new SQLite(frontend); }
protected:
@ -52,5 +52,4 @@ private:
threading::formatter::Ascii* io;
};
}
}
} // namespace zeek::logging::writer::detail