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

@ -26,7 +26,7 @@
#include "RemoteSerializer.h"
#include "PrefixTable.h"
#include "Conn.h"
#include "Logger.h"
#include "Reporter.h"
Val::Val(Func* f)
@ -253,7 +253,7 @@ bool Val::DoSerialize(SerialInfo* info) const
return false;
}
bro_logger->InternalError("should not be reached");
reporter->InternalError("should not be reached");
return false;
}
@ -410,7 +410,7 @@ bool Val::DoUnserialize(UnserialInfo* info)
return false;
}
bro_logger->InternalError("should not be reached");
reporter->InternalError("should not be reached");
return false;
}
@ -616,7 +616,7 @@ void Val::ValDescribe(ODesc* d) const
default:
// Don't call Internal(), that'll loop!
bro_logger->InternalError("Val description unavailable");
reporter->InternalError("Val description unavailable");
}
}
@ -964,7 +964,7 @@ AddrVal::AddrVal(const char* text) : Val(TYPE_ADDR)
#ifdef BROv6
Init(dotted_to_addr6(text));
#else
bro_logger->Error("bro wasn't compiled with IPv6 support");
reporter->Error("bro wasn't compiled with IPv6 support");
Init(uint32(0));
#endif
}
@ -1085,13 +1085,13 @@ static uint32 parse_dotted(const char* text, int& dots)
}
else
bro_logger->InternalError("scanf failed in parse_dotted()");
reporter->InternalError("scanf failed in parse_dotted()");
for ( int i = 0; i <= dots; ++i )
{
if ( addr[i] < 0 || addr[i] > 255 )
{
bro_logger->Error("bad dotted address", text);
reporter->Error("bad dotted address", text);
break;
}
}
@ -1105,7 +1105,7 @@ NetVal::NetVal(const char* text) : AddrVal(TYPE_NET)
uint32 a = parse_dotted(text, dots);
if ( addr_to_net(a) != a )
bro_logger->Error("bad net address", text);
reporter->Error("bad net address", text);
Init(uint32(htonl(a)));
}
@ -1998,7 +1998,7 @@ int TableVal::ExpandAndInit(Val* index, Val* new_val)
if ( iv->BaseTag() != TYPE_ANY )
{
if ( table_type->Indices()->Types()->length() != 1 )
bro_logger->InternalError("bad singleton list index");
reporter->InternalError("bad singleton list index");
for ( int i = 0; i < iv->Length(); ++i )
if ( ! ExpandAndInit(iv->Index(i), new_val ? new_val->Ref() : 0) )
@ -2193,7 +2193,7 @@ Val* TableVal::Delete(const Val* index)
Val* va = v ? (v->Value() ? v->Value() : this->Ref()) : 0;
if ( subnets && ! subnets->Remove(index) )
bro_logger->InternalError( "index not in prefix table" );
reporter->InternalError( "index not in prefix table" );
if ( LoggingAccess() )
{
@ -2235,7 +2235,7 @@ Val* TableVal::Delete(const HashKey* k)
{
Val* index = table_hash->RecoverVals(k);
if ( ! subnets->Remove(index) )
bro_logger->InternalError( "index not in prefix table" );
reporter->InternalError( "index not in prefix table" );
Unref(index);
}
@ -2316,7 +2316,7 @@ void TableVal::Describe(ODesc* d) const
TableEntryVal* v = tbl->NextEntry(k, c);
if ( ! v )
bro_logger->InternalError("hash table underflow in TableVal::Describe");
reporter->InternalError("hash table underflow in TableVal::Describe");
ListVal* vl = table_hash->RecoverVals(k);
int dim = vl->Length();
@ -2367,7 +2367,7 @@ void TableVal::Describe(ODesc* d) const
}
if ( tbl->NextEntry(c) )
bro_logger->InternalError("hash table overflow in TableVal::Describe");
reporter->InternalError("hash table overflow in TableVal::Describe");
if ( d->IsPortable() || d->IsReadable() )
{
@ -2489,7 +2489,7 @@ void TableVal::DoExpire(double t)
{
Val* index = RecoverIndex(k);
if ( ! subnets->Remove(index) )
bro_logger->InternalError( "index not in prefix table" );
reporter->InternalError( "index not in prefix table" );
Unref(index);
}
@ -2610,7 +2610,7 @@ bool TableVal::DoSerialize(SerialInfo* info) const
state = (State*) info->cont.RestoreState();
}
else
bro_logger->InternalError("unknown continuation state");
reporter->InternalError("unknown continuation state");
HashKey* k;
int count = 0;
@ -2695,7 +2695,7 @@ bool TableVal::DoSerialize(SerialInfo* info) const
{
info->cont.SaveState(state);
info->cont.Suspend();
bro_logger->Message("TableVals serialization suspended right in the middle.");
reporter->Message("TableVals serialization suspended right in the middle.");
return true;
}
}
@ -3489,7 +3489,7 @@ Val* check_and_promote(Val* v, const BroType* t, int is_init)
break;
default:
bro_logger->InternalError("bad internal type in check_and_promote()");
reporter->InternalError("bad internal type in check_and_promote()");
Unref(v);
return 0;
}
@ -3500,7 +3500,7 @@ Val* check_and_promote(Val* v, const BroType* t, int is_init)
int same_val(const Val* /* v1 */, const Val* /* v2 */)
{
bro_logger->InternalError("same_val not implemented");
reporter->InternalError("same_val not implemented");
return 0;
}
@ -3551,7 +3551,7 @@ int same_atomic_val(const Val* v1, const Val* v2)
return subnet_eq(v1->AsSubNet(), v2->AsSubNet());
default:
bro_logger->InternalError("same_atomic_val called for non-atomic value");
reporter->InternalError("same_atomic_val called for non-atomic value");
return 0;
}