mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Merge remote branch 'origin/topic/robin/reporting'
* origin/topic/robin/reporting: Syslog BiF now goes through the reporter as well. Avoiding infinite loops when an error message handlers triggers errors itself. Renaming the Logger to Reporter. Overhauling the internal reporting of messages to the user. Updating a bunch of tests/baselines as well. Conflicts: aux/broccoli policy.old/alarm.bro policy/all.bro policy/bro.init policy/frameworks/notice/weird.bro policy/notice.bro src/SSL-binpac.cc src/bro.bif src/main.cc
This commit is contained in:
commit
9709b1d522
152 changed files with 2625 additions and 1134 deletions
|
@ -273,7 +273,7 @@ bool LogVal::Read(SerializationFormat* fmt)
|
|||
}
|
||||
|
||||
default:
|
||||
internal_error("unsupported type %s in LogVal::Write", type_name(type));
|
||||
reporter->InternalError("unsupported type %s in LogVal::Write", type_name(type));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -374,7 +374,7 @@ bool LogVal::Write(SerializationFormat* fmt) const
|
|||
}
|
||||
|
||||
default:
|
||||
internal_error("unsupported type %s in LogVal::REad", type_name(type));
|
||||
reporter->InternalError("unsupported type %s in LogVal::REad", type_name(type));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -452,7 +452,7 @@ bool LogMgr::CreateStream(EnumVal* id, RecordVal* sval)
|
|||
|
||||
if ( ! same_type(rtype, BifType::Record::Log::Stream, 0) )
|
||||
{
|
||||
run_time("sval argument not of right type");
|
||||
reporter->Error("sval argument not of right type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -468,7 +468,7 @@ bool LogMgr::CreateStream(EnumVal* id, RecordVal* sval)
|
|||
|
||||
if ( ! LogVal::IsCompatibleType(columns->FieldType(i)) )
|
||||
{
|
||||
run_time("type of field '%s' is not support for logging output",
|
||||
reporter->Error("type of field '%s' is not support for logging output",
|
||||
columns->FieldName(i));
|
||||
|
||||
return false;
|
||||
|
@ -479,7 +479,7 @@ bool LogMgr::CreateStream(EnumVal* id, RecordVal* sval)
|
|||
|
||||
if ( ! log_attr_present )
|
||||
{
|
||||
run_time("logged record type does not have any &log attributes");
|
||||
reporter->Error("logged record type does not have any &log attributes");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -493,7 +493,7 @@ bool LogMgr::CreateStream(EnumVal* id, RecordVal* sval)
|
|||
|
||||
if ( ! etype->IsEvent() )
|
||||
{
|
||||
run_time("stream event is a function, not an event");
|
||||
reporter->Error("stream event is a function, not an event");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -501,13 +501,13 @@ bool LogMgr::CreateStream(EnumVal* id, RecordVal* sval)
|
|||
|
||||
if ( args->length() != 1 )
|
||||
{
|
||||
run_time("stream event must take a single argument");
|
||||
reporter->Error("stream event must take a single argument");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! same_type((*args)[0], columns) )
|
||||
{
|
||||
run_time("stream event's argument type does not match column record type");
|
||||
reporter->Error("stream event's argument type does not match column record type");
|
||||
return new Val(0, TYPE_BOOL);
|
||||
}
|
||||
}
|
||||
|
@ -627,7 +627,7 @@ bool LogMgr::TraverseRecord(Stream* stream, Filter* filter, RecordType* rt,
|
|||
|
||||
else
|
||||
{
|
||||
run_time("unsupported field type for log column");
|
||||
reporter->Error("unsupported field type for log column");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ bool LogMgr::TraverseRecord(Stream* stream, Filter* filter, RecordType* rt,
|
|||
|
||||
if ( ! filter->fields )
|
||||
{
|
||||
run_time("out of memory in add_filter");
|
||||
reporter->Error("out of memory in add_filter");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -685,7 +685,7 @@ bool LogMgr::AddFilter(EnumVal* id, RecordVal* fval)
|
|||
|
||||
if ( ! same_type(rtype, BifType::Record::Log::Filter, 0) )
|
||||
{
|
||||
run_time("filter argument not of right type");
|
||||
reporter->Error("filter argument not of right type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -836,7 +836,7 @@ bool LogMgr::Write(EnumVal* id, RecordVal* columns)
|
|||
|
||||
if ( ! columns )
|
||||
{
|
||||
run_time("incompatible log record type");
|
||||
reporter->Error("incompatible log record type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -878,7 +878,7 @@ bool LogMgr::Write(EnumVal* id, RecordVal* columns)
|
|||
|
||||
if ( ! v->Type()->Tag() == TYPE_STRING )
|
||||
{
|
||||
run_time("path_func did not return string");
|
||||
reporter->Error("path_func did not return string");
|
||||
Unref(v);
|
||||
return false;
|
||||
}
|
||||
|
@ -1062,7 +1062,7 @@ LogVal* LogMgr::ValToLogVal(Val* val, BroType* ty)
|
|||
}
|
||||
|
||||
default:
|
||||
internal_error("unsupported type for log_write");
|
||||
reporter->InternalError("unsupported type for log_write");
|
||||
}
|
||||
|
||||
return lval;
|
||||
|
@ -1127,7 +1127,7 @@ LogWriter* LogMgr::CreateWriter(EnumVal* id, EnumVal* writer, string path,
|
|||
{
|
||||
if ( ld->type == BifEnum::Log::WRITER_DEFAULT )
|
||||
{
|
||||
run_time("unknow writer when creating writer");
|
||||
reporter->Error("unknow writer when creating writer");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1286,7 +1286,7 @@ bool LogMgr::Flush(EnumVal* id)
|
|||
|
||||
void LogMgr::Error(LogWriter* writer, const char* msg)
|
||||
{
|
||||
run_time(fmt("error with writer for %s: %s",
|
||||
reporter->Error(fmt("error with writer for %s: %s",
|
||||
writer->Path().c_str(), msg));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue