mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00

These two are almost always used in conjunction with each other, and TaggedComponent is never used by itself. Combining them together into a single class will help simplify some of the code around managing the mapping between Tags and Components.
32 lines
670 B
C++
32 lines
670 B
C++
// See the file "COPYING" in the main distribution directory for copyright.
|
|
|
|
#include "zeek/logging/Component.h"
|
|
|
|
#include "zeek/Desc.h"
|
|
#include "zeek/logging/Manager.h"
|
|
#include "zeek/util.h"
|
|
|
|
namespace zeek::logging
|
|
{
|
|
|
|
Component::Component(const std::string& name, factory_callback arg_factory)
|
|
: plugin::Component(plugin::component::WRITER, name, 0, log_mgr->GetTagType())
|
|
{
|
|
factory = arg_factory;
|
|
}
|
|
|
|
void Component::Initialize()
|
|
{
|
|
InitializeTag();
|
|
log_mgr->RegisterComponent(this, "WRITER_");
|
|
}
|
|
|
|
Component::~Component() { }
|
|
|
|
void Component::DoDescribe(ODesc* d) const
|
|
{
|
|
d->Add("Log::WRITER_");
|
|
d->Add(CanonicalName());
|
|
}
|
|
|
|
} // namespace zeek::logging
|