mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Move DebugLogger to zeek namespaces
This commit is contained in:
parent
a2a435360a
commit
886fc102b8
40 changed files with 358 additions and 317 deletions
|
@ -65,7 +65,7 @@ void Manager::SearchDynamicPlugins(const std::string& dir)
|
|||
|
||||
if ( ! is_dir(dir) )
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, "Not a valid plugin directory: %s", dir.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, "Not a valid plugin directory: %s", dir.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -91,14 +91,14 @@ void Manager::SearchDynamicPlugins(const std::string& dir)
|
|||
|
||||
if ( dynamic_plugins.find(lower_name) != dynamic_plugins.end() )
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, "Found already known plugin %s in %s, ignoring", name.c_str(), dir.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, "Found already known plugin %s in %s, ignoring", name.c_str(), dir.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
// Record it, so that we can later activate it.
|
||||
dynamic_plugins.insert(std::make_pair(lower_name, dir));
|
||||
|
||||
DBG_LOG(DBG_PLUGINS, "Found plugin %s in %s", name.c_str(), dir.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, "Found plugin %s in %s", name.c_str(), dir.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ void Manager::SearchDynamicPlugins(const std::string& dir)
|
|||
|
||||
if ( ! d )
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, "Cannot open directory %s", dir.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, "Cannot open directory %s", dir.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ void Manager::SearchDynamicPlugins(const std::string& dir)
|
|||
|
||||
if( stat(path.c_str(), &st) < 0 )
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, "Cannot stat %s: %s", path.c_str(), strerror(errno));
|
||||
DBG_LOG(zeek::DBG_PLUGINS, "Cannot stat %s: %s", path.c_str(), strerror(errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -172,14 +172,14 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
|
||||
std::string dir = m->second + "/";
|
||||
|
||||
DBG_LOG(DBG_PLUGINS, "Activating plugin %s", name.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, "Activating plugin %s", name.c_str());
|
||||
|
||||
// Add the "scripts" and "bif" directories to ZEEKPATH.
|
||||
std::string scripts = dir + "scripts";
|
||||
|
||||
if ( is_dir(scripts) )
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, " Adding %s to ZEEKPATH", scripts.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, " Adding %s to ZEEKPATH", scripts.c_str());
|
||||
add_to_bro_path(scripts);
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
|
||||
if ( is_file(init) )
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, " Loading %s", init.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, " Loading %s", init.c_str());
|
||||
warn_if_legacy_script(init);
|
||||
scripts_to_load.push_back(init);
|
||||
break;
|
||||
|
@ -206,7 +206,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
|
||||
if ( is_file(init) )
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, " Loading %s", init.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, " Loading %s", init.c_str());
|
||||
warn_if_legacy_script(init);
|
||||
scripts_to_load.push_back(init);
|
||||
break;
|
||||
|
@ -219,7 +219,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
|
||||
if ( is_file(init) )
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, " Loading %s", init.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, " Loading %s", init.c_str());
|
||||
warn_if_legacy_script(init);
|
||||
scripts_to_load.push_back(init);
|
||||
break;
|
||||
|
@ -230,7 +230,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
|
||||
string dypattern = dir + "/lib/*." + HOST_ARCHITECTURE + DYNAMIC_PLUGIN_SUFFIX;
|
||||
|
||||
DBG_LOG(DBG_PLUGINS, " Searching for shared libraries %s", dypattern.c_str());
|
||||
DBG_LOG(zeek::DBG_PLUGINS, " Searching for shared libraries %s", dypattern.c_str());
|
||||
|
||||
glob_t gl;
|
||||
|
||||
|
@ -256,7 +256,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
|
||||
current_plugin->SetDynamic(true);
|
||||
current_plugin->DoConfigure();
|
||||
DBG_LOG(DBG_PLUGINS, " InitialzingComponents");
|
||||
DBG_LOG(zeek::DBG_PLUGINS, " InitialzingComponents");
|
||||
current_plugin->InitializeComponents();
|
||||
|
||||
plugins_by_path.insert(std::make_pair(normalize_path(dir), current_plugin));
|
||||
|
@ -276,7 +276,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
current_sopath = nullptr;
|
||||
current_plugin = nullptr;
|
||||
|
||||
DBG_LOG(DBG_PLUGINS, " Loaded %s", path);
|
||||
DBG_LOG(zeek::DBG_PLUGINS, " Loaded %s", path);
|
||||
}
|
||||
|
||||
globfree(&gl);
|
||||
|
@ -284,7 +284,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
|
||||
else
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, " No shared library found");
|
||||
DBG_LOG(zeek::DBG_PLUGINS, " No shared library found");
|
||||
}
|
||||
|
||||
// Mark this plugin as activated by clearing the path.
|
||||
|
@ -573,7 +573,7 @@ void Manager::DisableHook(zeek::plugin::HookType hook, Plugin* plugin)
|
|||
|
||||
void Manager::RequestEvent(EventHandlerPtr handler, Plugin* plugin)
|
||||
{
|
||||
DBG_LOG(DBG_PLUGINS, "Plugin %s requested event %s",
|
||||
DBG_LOG(zeek::DBG_PLUGINS, "Plugin %s requested event %s",
|
||||
plugin->Name().c_str(), handler->Name());
|
||||
handler->SetGenerateAlways();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue