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

@ -35,7 +35,7 @@
#include "Event.h"
#include "Net.h"
#include "Var.h"
#include "Logger.h"
#include "Reporter.h"
extern "C" {
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
@ -353,7 +353,7 @@ DNS_Mgr::DNS_Mgr(DNS_MgrMode arg_mode)
nb_dns = nb_dns_init(err);
if ( ! nb_dns )
bro_logger->Warning(fmt("problem initializing NB-DNS: %s", err));
reporter->Warning(fmt("problem initializing NB-DNS: %s", err));
dns_mapping_valid = dns_mapping_unverified = dns_mapping_new_name =
dns_mapping_lost_name = dns_mapping_name_changed =
@ -440,7 +440,7 @@ TableVal* DNS_Mgr::LookupHost(const char* name)
return d->Addrs()->ConvertToSet();
else
{
bro_logger->Warning("no such host:", name);
reporter->Warning("no such host:", name);
return empty_addr_set();
}
}
@ -453,7 +453,7 @@ TableVal* DNS_Mgr::LookupHost(const char* name)
return empty_addr_set();
case DNS_FORCE:
bro_logger->InternalError("can't find DNS entry for %s in cache", name);
reporter->InternalError("can't find DNS entry for %s in cache", name);
return 0;
case DNS_DEFAULT:
@ -462,7 +462,7 @@ TableVal* DNS_Mgr::LookupHost(const char* name)
return LookupHost(name);
default:
bro_logger->InternalError("bad mode in DNS_Mgr::LookupHost");
reporter->InternalError("bad mode in DNS_Mgr::LookupHost");
return 0;
}
}
@ -483,7 +483,7 @@ Val* DNS_Mgr::LookupAddr(uint32 addr)
return d->Host();
else
{
bro_logger->Warning("can't resolve IP address:", dotted_addr(addr));
reporter->Warning("can't resolve IP address:", dotted_addr(addr));
return new StringVal(dotted_addr(addr));
}
}
@ -496,7 +496,7 @@ Val* DNS_Mgr::LookupAddr(uint32 addr)
return new StringVal("<none>");
case DNS_FORCE:
bro_logger->InternalError("can't find DNS entry for %s in cache",
reporter->InternalError("can't find DNS entry for %s in cache",
dotted_addr(addr));
return 0;
@ -506,7 +506,7 @@ Val* DNS_Mgr::LookupAddr(uint32 addr)
return LookupAddr(addr);
default:
bro_logger->InternalError("bad mode in DNS_Mgr::LookupHost");
reporter->InternalError("bad mode in DNS_Mgr::LookupHost");
return 0;
}
}
@ -567,7 +567,7 @@ void DNS_Mgr::Resolve()
struct nb_dns_result r;
status = nb_dns_activity(nb_dns, &r, err);
if ( status < 0 )
bro_logger->InternalError(
reporter->InternalError(
"NB-DNS error in DNS_Mgr::WaitForReplies (%s)",
err);
else if ( status > 0 )
@ -745,7 +745,7 @@ void DNS_Mgr::CompareMappings(DNS_Mapping* prev_dm, DNS_Mapping* new_dm)
ListVal* new_a = new_dm->Addrs();
if ( ! prev_a || ! new_a )
bro_logger->InternalError("confused in DNS_Mgr::CompareMappings");
reporter->InternalError("confused in DNS_Mgr::CompareMappings");
ListVal* prev_delta = AddrListDelta(prev_a, new_a);
ListVal* new_delta = AddrListDelta(new_a, prev_a);
@ -815,7 +815,7 @@ void DNS_Mgr::LoadCache(FILE* f)
}
if ( ! m->NoMapping() )
bro_logger->InternalError("DNS cache corrupted");
reporter->InternalError("DNS cache corrupted");
delete m;
fclose(f);
@ -935,7 +935,7 @@ void DNS_Mgr::IssueAsyncRequests()
if ( ! dr->MakeRequest(nb_dns) )
{
bro_logger->Error("can't issue DNS request");
reporter->Error("can't issue DNS request");
req->Timeout();
continue;
}
@ -1048,7 +1048,7 @@ void DNS_Mgr::Process()
int status = nb_dns_activity(nb_dns, &r, err);
if ( status < 0 )
bro_logger->InternalError("NB-DNS error in DNS_Mgr::Process (%s)", err);
reporter->InternalError("NB-DNS error in DNS_Mgr::Process (%s)", err);
else if ( status > 0 )
{
@ -1072,7 +1072,7 @@ int DNS_Mgr::AnswerAvailable(int timeout)
{
int fd = nb_dns_fd(nb_dns);
if ( fd < 0 )
bro_logger->InternalError("nb_dns_fd() failed in DNS_Mgr::WaitForReplies");
reporter->InternalError("nb_dns_fd() failed in DNS_Mgr::WaitForReplies");
fd_set read_fds;
@ -1089,11 +1089,11 @@ int DNS_Mgr::AnswerAvailable(int timeout)
{
if ( errno == EINTR )
return -1;
bro_logger->InternalError("problem with DNS select");
reporter->InternalError("problem with DNS select");
}
if ( status > 1 )
bro_logger->InternalError("strange return from DNS select");
reporter->InternalError("strange return from DNS select");
return status;
}