Move DebugLogger to zeek namespaces

This commit is contained in:
Tim Wojtulewicz 2020-07-21 14:16:42 -07:00
parent a2a435360a
commit 886fc102b8
40 changed files with 358 additions and 317 deletions

View file

@ -217,7 +217,7 @@ Supervisor::Supervisor(Supervisor::Config cfg, SupervisorStemHandle sh)
stem_stderr.prefix = "[supervisor:STDERR] ";
stem_stderr.stream = stderr;
DBG_LOG(DBG_SUPERVISOR, "forked stem process %d", stem_pid);
DBG_LOG(zeek::DBG_SUPERVISOR, "forked stem process %d", stem_pid);
setsignal(SIGCHLD, supervisor_signal_handler);
int status;
@ -251,14 +251,14 @@ Supervisor::~Supervisor()
if ( ! stem_pid )
{
DBG_LOG(DBG_SUPERVISOR, "shutdown, stem process already exited");
DBG_LOG(zeek::DBG_SUPERVISOR, "shutdown, stem process already exited");
return;
}
iosource_mgr->UnregisterFd(signal_flare.FD(), this);
iosource_mgr->UnregisterFd(stem_pipe->InFD(), this);
DBG_LOG(DBG_SUPERVISOR, "shutdown, killing stem process %d", stem_pid);
DBG_LOG(zeek::DBG_SUPERVISOR, "shutdown, killing stem process %d", stem_pid);
auto kill_res = kill(stem_pid, SIGTERM);
@ -318,12 +318,12 @@ void Supervisor::ReapStem()
if ( WIFEXITED(status) )
{
DBG_LOG(DBG_SUPERVISOR, "stem process exited with status %d",
DBG_LOG(zeek::DBG_SUPERVISOR, "stem process exited with status %d",
WEXITSTATUS(status));
}
else if ( WIFSIGNALED(status) )
{
DBG_LOG(DBG_SUPERVISOR, "stem process terminated by signal %d",
DBG_LOG(zeek::DBG_SUPERVISOR, "stem process terminated by signal %d",
WTERMSIG(status));
}
else
@ -384,7 +384,7 @@ void Supervisor::HandleChildSignal()
{
if ( last_signal >= 0 )
{
DBG_LOG(DBG_SUPERVISOR, "Supervisor received signal %d", last_signal);
DBG_LOG(zeek::DBG_SUPERVISOR, "Supervisor received signal %d", last_signal);
last_signal = -1;
}
@ -394,7 +394,7 @@ void Supervisor::HandleChildSignal()
{
ReapStem();
DBG_LOG(DBG_SUPERVISOR, "Supervisor processed child signal %s",
DBG_LOG(zeek::DBG_SUPERVISOR, "Supervisor processed child signal %s",
stem_pid ? "(spurious)" : "");
}
@ -471,7 +471,7 @@ void Supervisor::HandleChildSignal()
"redirected stderr pipe");
}
DBG_LOG(DBG_SUPERVISOR, "stem process revived, new pid: %d", stem_pid);
DBG_LOG(zeek::DBG_SUPERVISOR, "stem process revived, new pid: %d", stem_pid);
// Parent supervisor process resends node configurations to recreate
// the desired process hierarchy.
@ -591,7 +591,7 @@ size_t Supervisor::ProcessMessages()
for ( auto& msg : msgs )
{
DBG_LOG(DBG_SUPERVISOR, "read msg from Stem: %s", msg.data());
DBG_LOG(zeek::DBG_SUPERVISOR, "read msg from Stem: %s", msg.data());
std::vector<std::string> msg_tokens;
tokenize_string(msg, " ", &msg_tokens);
const auto& type = msg_tokens[0];