Renaming the Logger to Reporter.

Also changing output to not include timestamps when we haven't started
processing packets yet.
This commit is contained in:
Robin Sommer 2011-07-01 09:22:33 -07:00
parent 93894eed9b
commit 66e2c3b623
123 changed files with 722 additions and 713 deletions

View file

@ -9,7 +9,7 @@
#include "Expr.h"
#include "Scope.h"
#include "Serializer.h"
#include "Logger.h"
#include "Reporter.h"
#include <string>
#include <list>
@ -316,7 +316,7 @@ int TypeList::AllMatch(const BroType* t, int is_init) const
void TypeList::Append(BroType* t)
{
if ( pure_type && ! same_type(t, pure_type) )
bro_logger->InternalError("pure type-list violation");
reporter->InternalError("pure type-list violation");
types.append(t);
}
@ -933,7 +933,7 @@ void RecordType::Init(TypeList* arg_base)
if ( fields->Lookup(tdij->id) )
{
bro_logger->Error("duplicate field", tdij->id);
reporter->Error("duplicate field", tdij->id);
continue;
}
@ -1024,7 +1024,7 @@ const TypeDecl* RecordType::FieldDecl(int field) const
{
RecordField* rf = fields->NthEntry(field);
if ( ! rf )
bro_logger->InternalError("missing field in RecordType::FieldDecl");
reporter->InternalError("missing field in RecordType::FieldDecl");
BroType* bt = (*base->Types())[rf->base];
RecordType* rbt = bt->AsRecordType();
@ -1341,7 +1341,7 @@ CommentedEnumType::~CommentedEnumType()
}
}
// Note, we use bro_logger->Error() here (not Error()) to include the current script
// Note, we use reporter->Error() here (not Error()) to include the current script
// location in the error message, rather than the one where the type was
// originally defined.
void EnumType::AddName(const string& module_name, const char* name, bool is_export)
@ -1349,7 +1349,7 @@ void EnumType::AddName(const string& module_name, const char* name, bool is_expo
/* implicit, auto-increment */
if ( counter < 0)
{
bro_logger->Error("cannot mix explicit enumerator assignment and implicit auto-increment");
reporter->Error("cannot mix explicit enumerator assignment and implicit auto-increment");
SetError();
return;
}
@ -1362,7 +1362,7 @@ void EnumType::AddName(const string& module_name, const char* name, bro_int_t va
/* explicit value specified */
if ( counter > 0 )
{
bro_logger->Error("cannot mix explicit enumerator assignment and implicit auto-increment");
reporter->Error("cannot mix explicit enumerator assignment and implicit auto-increment");
SetError();
return;
}
@ -1395,7 +1395,7 @@ void EnumType::AddNameInternal(const string& module_name, const char* name, bro_
ID *id;
if ( Lookup(val) )
{
bro_logger->Error("enumerator value in enumerated type definition already exists");
reporter->Error("enumerator value in enumerated type definition already exists");
SetError();
return;
}
@ -1409,7 +1409,7 @@ void EnumType::AddNameInternal(const string& module_name, const char* name, bro_
}
else
{
bro_logger->Error("identifier or enumerator value in enumerated type definition already exists");
reporter->Error("identifier or enumerator value in enumerated type definition already exists");
SetError();
return;
}
@ -1776,7 +1776,7 @@ int same_type(const BroType* t1, const BroType* t2, int is_init)
return same_type(t1, t2, is_init);
case TYPE_UNION:
bro_logger->Error("union type in same_type()");
reporter->Error("union type in same_type()");
}
return 0;
}
@ -1821,7 +1821,7 @@ const BroType* flatten_type(const BroType* t)
const type_list* types = tl->Types();
if ( types->length() == 0 )
bro_logger->InternalError("empty type list in flatten_type");
reporter->InternalError("empty type list in flatten_type");
const BroType* ft = (*types)[0];
if ( types->length() == 1 || tl->AllMatch(ft, 0) )
@ -1870,7 +1870,7 @@ int is_assignable(BroType* t)
return 0;
case TYPE_UNION:
bro_logger->Error("union type in is_assignable()");
reporter->Error("union type in is_assignable()");
}
return 0;
@ -1899,7 +1899,7 @@ TypeTag max_type(TypeTag t1, TypeTag t2)
}
else
{
bro_logger->InternalError("non-arithmetic tags in max_type()");
reporter->InternalError("non-arithmetic tags in max_type()");
return TYPE_ERROR;
}
}
@ -1994,7 +1994,7 @@ BroType* merge_types(const BroType* t1, const BroType* t2)
return new TableType(tl3, y3);
else
{
bro_logger->InternalError("bad tag in merge_types");
reporter->InternalError("bad tag in merge_types");
return 0;
}
}
@ -2112,11 +2112,11 @@ BroType* merge_types(const BroType* t1, const BroType* t2)
return new FileType(merge_types(t1->YieldType(), t2->YieldType()));
case TYPE_UNION:
bro_logger->InternalError("union type in merge_types()");
reporter->InternalError("union type in merge_types()");
return 0;
default:
bro_logger->InternalError("bad type in merge_types()");
reporter->InternalError("bad type in merge_types()");
return 0;
}
}
@ -2128,7 +2128,7 @@ BroType* merge_type_list(ListExpr* elements)
if ( tl->length() < 1 )
{
bro_logger->Error("no type can be inferred for empty list");
reporter->Error("no type can be inferred for empty list");
return 0;
}
@ -2145,7 +2145,7 @@ BroType* merge_type_list(ListExpr* elements)
}
if ( ! t )
bro_logger->Error("inconsistent types in list");
reporter->Error("inconsistent types in list");
return t;
}