mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +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
|
@ -319,7 +319,7 @@ bool Manager::CreateStream(zeek::EnumVal* id, zeek::RecordVal* sval)
|
|||
|
||||
streams[idx]->enable_remote = zeek::id::find_val("Log::enable_remote_logging")->AsBool();
|
||||
|
||||
DBG_LOG(DBG_LOGGING, "Created new logging stream '%s', raising event %s",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Created new logging stream '%s', raising event %s",
|
||||
streams[idx]->name.c_str(), event ? streams[idx]->event->Name() : "<none>");
|
||||
|
||||
return true;
|
||||
|
@ -341,7 +341,7 @@ bool Manager::RemoveStream(zeek::EnumVal* id)
|
|||
{
|
||||
WriterInfo* winfo = i->second;
|
||||
|
||||
DBG_LOG(DBG_LOGGING, "Removed writer '%s' from stream '%s'",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Removed writer '%s' from stream '%s'",
|
||||
winfo->writer->Name(), stream->name.c_str());
|
||||
|
||||
winfo->writer->Stop();
|
||||
|
@ -354,7 +354,7 @@ bool Manager::RemoveStream(zeek::EnumVal* id)
|
|||
delete stream;
|
||||
streams[idx] = nullptr;
|
||||
|
||||
DBG_LOG(DBG_LOGGING, "Removed logging stream '%s'", sname.c_str());
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Removed logging stream '%s'", sname.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ bool Manager::EnableStream(zeek::EnumVal* id)
|
|||
|
||||
stream->enabled = true;
|
||||
|
||||
DBG_LOG(DBG_LOGGING, "Reenabled logging stream '%s'", stream->name.c_str());
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Reenabled logging stream '%s'", stream->name.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ bool Manager::DisableStream(zeek::EnumVal* id)
|
|||
|
||||
stream->enabled = false;
|
||||
|
||||
DBG_LOG(DBG_LOGGING, "Disabled logging stream '%s'", stream->name.c_str());
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Disabled logging stream '%s'", stream->name.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -641,18 +641,18 @@ bool Manager::AddFilter(zeek::EnumVal* id, zeek::RecordVal* fval)
|
|||
ODesc desc;
|
||||
writer->Describe(&desc);
|
||||
|
||||
DBG_LOG(DBG_LOGGING, "Created new filter '%s' for stream '%s'",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Created new filter '%s' for stream '%s'",
|
||||
filter->name.c_str(), stream->name.c_str());
|
||||
|
||||
DBG_LOG(DBG_LOGGING, " writer : %s", desc.Description());
|
||||
DBG_LOG(DBG_LOGGING, " path : %s", filter->path.c_str());
|
||||
DBG_LOG(DBG_LOGGING, " path_func : %s", (filter->path_func ? "set" : "not set"));
|
||||
DBG_LOG(DBG_LOGGING, " pred : %s", (filter->pred ? "set" : "not set"));
|
||||
DBG_LOG(zeek::DBG_LOGGING, " writer : %s", desc.Description());
|
||||
DBG_LOG(zeek::DBG_LOGGING, " path : %s", filter->path.c_str());
|
||||
DBG_LOG(zeek::DBG_LOGGING, " path_func : %s", (filter->path_func ? "set" : "not set"));
|
||||
DBG_LOG(zeek::DBG_LOGGING, " pred : %s", (filter->pred ? "set" : "not set"));
|
||||
|
||||
for ( int i = 0; i < filter->num_fields; i++ )
|
||||
{
|
||||
threading::Field* field = filter->fields[i];
|
||||
DBG_LOG(DBG_LOGGING, " field %10s: %s",
|
||||
DBG_LOG(zeek::DBG_LOGGING, " field %10s: %s",
|
||||
field->name, zeek::type_name(field->type));
|
||||
}
|
||||
#endif
|
||||
|
@ -678,7 +678,7 @@ bool Manager::RemoveFilter(zeek::EnumVal* id, const string& name)
|
|||
{
|
||||
Filter* filter = *i;
|
||||
stream->filters.erase(i);
|
||||
DBG_LOG(DBG_LOGGING, "Removed filter '%s' from stream '%s'",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Removed filter '%s' from stream '%s'",
|
||||
filter->name.c_str(), stream->name.c_str());
|
||||
delete filter;
|
||||
return true;
|
||||
|
@ -686,7 +686,7 @@ bool Manager::RemoveFilter(zeek::EnumVal* id, const string& name)
|
|||
}
|
||||
|
||||
// If we don't find the filter, we don't treat that as an error.
|
||||
DBG_LOG(DBG_LOGGING, "No filter '%s' for removing from stream '%s'",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "No filter '%s' for removing from stream '%s'",
|
||||
name.c_str(), stream->name.c_str());
|
||||
|
||||
return true;
|
||||
|
@ -774,7 +774,7 @@ bool Manager::Write(zeek::EnumVal* id, zeek::RecordVal* columns_arg)
|
|||
path = v->AsString()->CheckString();
|
||||
|
||||
#ifdef DEBUG
|
||||
DBG_LOG(DBG_LOGGING, "Path function for filter '%s' on stream '%s' return '%s'",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Path function for filter '%s' on stream '%s' return '%s'",
|
||||
filter->name.c_str(), stream->name.c_str(), path.c_str());
|
||||
#endif
|
||||
}
|
||||
|
@ -901,7 +901,7 @@ bool Manager::Write(zeek::EnumVal* id, zeek::RecordVal* columns_arg)
|
|||
DeleteVals(filter->num_fields, vals);
|
||||
|
||||
#ifdef DEBUG
|
||||
DBG_LOG(DBG_LOGGING, "Hook prevented writing to filter '%s' on stream '%s'",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Hook prevented writing to filter '%s' on stream '%s'",
|
||||
filter->name.c_str(), stream->name.c_str());
|
||||
#endif
|
||||
return true;
|
||||
|
@ -912,7 +912,7 @@ bool Manager::Write(zeek::EnumVal* id, zeek::RecordVal* columns_arg)
|
|||
writer->Write(filter->num_fields, vals);
|
||||
|
||||
#ifdef DEBUG
|
||||
DBG_LOG(DBG_LOGGING, "Wrote record to filter '%s' on stream '%s'",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Wrote record to filter '%s' on stream '%s'",
|
||||
filter->name.c_str(), stream->name.c_str());
|
||||
#endif
|
||||
}
|
||||
|
@ -1254,7 +1254,7 @@ bool Manager::WriteFromRemote(zeek::EnumVal* id, zeek::EnumVal* writer, const st
|
|||
#ifdef DEBUG
|
||||
ODesc desc;
|
||||
id->Describe(&desc);
|
||||
DBG_LOG(DBG_LOGGING, "unknown stream %s in Manager::Write()",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "unknown stream %s in Manager::Write()",
|
||||
desc.Description());
|
||||
#endif
|
||||
DeleteVals(num_fields, vals);
|
||||
|
@ -1276,7 +1276,7 @@ bool Manager::WriteFromRemote(zeek::EnumVal* id, zeek::EnumVal* writer, const st
|
|||
#ifdef DEBUG
|
||||
ODesc desc;
|
||||
id->Describe(&desc);
|
||||
DBG_LOG(DBG_LOGGING, "unknown writer %s in Manager::Write()",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "unknown writer %s in Manager::Write()",
|
||||
desc.Description());
|
||||
#endif
|
||||
DeleteVals(num_fields, vals);
|
||||
|
@ -1285,7 +1285,7 @@ bool Manager::WriteFromRemote(zeek::EnumVal* id, zeek::EnumVal* writer, const st
|
|||
|
||||
w->second->writer->Write(num_fields, vals);
|
||||
|
||||
DBG_LOG(DBG_LOGGING,
|
||||
DBG_LOG(zeek::DBG_LOGGING,
|
||||
"Wrote pre-filtered record to path '%s' on stream '%s'",
|
||||
path.c_str(), stream->name.c_str());
|
||||
|
||||
|
@ -1484,7 +1484,7 @@ void Manager::InstallRotationTimer(WriterInfo* winfo)
|
|||
|
||||
zeek::detail::timer_mgr->Add(winfo->rotation_timer);
|
||||
|
||||
DBG_LOG(DBG_LOGGING, "Scheduled rotation timer for %s to %.6f",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Scheduled rotation timer for %s to %.6f",
|
||||
winfo->writer->Name(), winfo->rotation_timer->Time());
|
||||
}
|
||||
}
|
||||
|
@ -1552,7 +1552,7 @@ std::string Manager::FormatRotationPath(zeek::EnumValPtr writer,
|
|||
|
||||
void Manager::Rotate(WriterInfo* winfo)
|
||||
{
|
||||
DBG_LOG(DBG_LOGGING, "Rotating %s at %.6f",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Rotating %s at %.6f",
|
||||
winfo->writer->Name(), network_time);
|
||||
|
||||
static auto default_ppf = zeek::id::find_func("Log::__default_rotation_postprocessor");
|
||||
|
@ -1584,12 +1584,12 @@ bool Manager::FinishedRotation(WriterFrontend* writer, const char* new_name, con
|
|||
|
||||
if ( ! success )
|
||||
{
|
||||
DBG_LOG(DBG_LOGGING, "Non-successful rotating writer '%s', file '%s' at %.6f,",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Non-successful rotating writer '%s', file '%s' at %.6f,",
|
||||
writer->Name(), filename, network_time);
|
||||
return true;
|
||||
}
|
||||
|
||||
DBG_LOG(DBG_LOGGING, "Finished rotating %s at %.6f, new name %s",
|
||||
DBG_LOG(zeek::DBG_LOGGING, "Finished rotating %s at %.6f, new name %s",
|
||||
writer->Name(), network_time, new_name);
|
||||
|
||||
WriterInfo* winfo = FindWriter(writer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue