zeek/src/logging/Component.cc
Tim Wojtulewicz 7d66f4252f Unify plugin::Component and plugin::TaggedComponent into a single class
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.
2021-11-23 19:36:49 -07:00

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