Renaming reporter_message to report_info.

Same change internally.
This commit is contained in:
Robin Sommer 2011-07-07 08:43:29 -07:00
parent eb0580c622
commit df1b2f922b
14 changed files with 34 additions and 34 deletions

@ -1 +1 @@
Subproject commit 5f04d82f88e619e25f63db651d0ac887c448d85d Subproject commit 9866a00e78b088315e632960aaa230635bca326a

@ -1 +1 @@
Subproject commit 2c47f028b5bf2f9477d0b42cd7fb96277adb1f85 Subproject commit a9aeb2e1a8434c583c75f5941b58dc69a7517444

View file

@ -537,7 +537,7 @@ void net_get_final_stats()
{ {
struct PktSrc::Stats s; struct PktSrc::Stats s;
ps->Statistics(&s); ps->Statistics(&s);
reporter->Message("%d packets received on interface %s, %d dropped\n", reporter->Info("%d packets received on interface %s, %d dropped\n",
s.received, ps->Interface(), s.dropped); s.received, ps->Interface(), s.dropped);
} }
} }
@ -611,7 +611,7 @@ static double suspend_start = 0;
void net_suspend_processing() void net_suspend_processing()
{ {
if ( _processing_suspended == 0 ) if ( _processing_suspended == 0 )
reporter->Message("processing suspended"); reporter->Info("processing suspended");
++_processing_suspended; ++_processing_suspended;
} }
@ -620,7 +620,7 @@ void net_continue_processing()
{ {
if ( _processing_suspended == 1 ) if ( _processing_suspended == 1 )
{ {
reporter->Message("processing continued"); reporter->Info("processing continued");
loop_over_list(pkt_srcs, i) loop_over_list(pkt_srcs, i)
pkt_srcs[i]->ContinueAfterSuspend(); pkt_srcs[i]->ContinueAfterSuspend();
} }

View file

@ -286,7 +286,7 @@ bool PersistenceSerializer::SendState(SourceID peer, bool may_suspend)
status->conns = &persistent_conns; status->conns = &persistent_conns;
status->peer = peer; status->peer = peer;
reporter->Message("Sending state..."); reporter->Info("Sending state...");
return RunSerialization(status); return RunSerialization(status);
} }
@ -301,7 +301,7 @@ bool PersistenceSerializer::SendConfig(SourceID peer, bool may_suspend)
status->ids = global_scope()->GetIDs(); status->ids = global_scope()->GetIDs();
status->peer = peer; status->peer = peer;
reporter->Message("Sending config..."); reporter->Info("Sending config...");
return RunSerialization(status); return RunSerialization(status);
} }

View file

@ -463,7 +463,7 @@ PktInterfaceSrc::PktInterfaceSrc(const char* arg_interface, const char* filter,
// ### This needs autoconf'ing. // ### This needs autoconf'ing.
#ifdef HAVE_PCAP_INT_H #ifdef HAVE_PCAP_INT_H
reporter->Message("pcap bufsize = %d\n", ((struct pcap *) pd)->bufsize); reporter->Info("pcap bufsize = %d\n", ((struct pcap *) pd)->bufsize);
#endif #endif
#ifdef HAVE_LINUX #ifdef HAVE_LINUX
@ -486,7 +486,7 @@ PktInterfaceSrc::PktInterfaceSrc(const char* arg_interface, const char* filter,
// Couldn't get header size. // Couldn't get header size.
return; return;
reporter->Message("listening on %s\n", interface); reporter->Info("listening on %s\n", interface);
} }
else else
closed = true; closed = true;

View file

@ -35,11 +35,11 @@ Reporter::~Reporter()
closelog(); closelog();
} }
void Reporter::Message(const char* fmt, ...) void Reporter::Info(const char* fmt, ...)
{ {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
DoLog("", reporter_message, stderr, 0, 0, true, true, fmt, ap); DoLog("", reporter_info, stderr, 0, 0, true, true, fmt, ap);
va_end(ap); va_end(ap);
} }

View file

@ -22,7 +22,7 @@ public:
// Report an informational message, nothing that needs specific // Report an informational message, nothing that needs specific
// attention. // attention.
void Message(const char* fmt, ...); void Info(const char* fmt, ...);
// Report a warning that may indicate a problem. // Report a warning that may indicate a problem.
void Warning(const char* fmt, ...); void Warning(const char* fmt, ...);

View file

@ -2695,7 +2695,7 @@ bool TableVal::DoSerialize(SerialInfo* info) const
{ {
info->cont.SaveState(state); info->cont.SaveState(state);
info->cont.Suspend(); info->cont.Suspend();
reporter->Message("TableVals serialization suspended right in the middle."); reporter->Info("TableVals serialization suspended right in the middle.");
return true; return true;
} }
} }

View file

@ -477,6 +477,6 @@ event netflow_v5_record%(r: nf_v5_record%);
# Different types of reporter messages. These won't be called # Different types of reporter messages. These won't be called
# recursively. # recursively.
event reporter_message%(t: time, msg: string, location: string%) &error_handler; event reporter_info%(t: time, msg: string, location: string%) &error_handler;
event reporter_warning%(t: time, msg: string, location: string%) &error_handler; event reporter_warning%(t: time, msg: string, location: string%) &error_handler;
event reporter_error%(t: time, msg: string, location: string%) &error_handler; event reporter_error%(t: time, msg: string, location: string%) &error_handler;

View file

@ -299,7 +299,7 @@ void termination_signal()
set_processing_status("TERMINATING", "termination_signal"); set_processing_status("TERMINATING", "termination_signal");
Val sval(signal_val, TYPE_COUNT); Val sval(signal_val, TYPE_COUNT);
reporter->Message("received termination signal"); reporter->Info("received termination signal");
net_get_final_stats(); net_get_final_stats();
done_with_network(); done_with_network();
net_delete(); net_delete();
@ -943,9 +943,9 @@ int main(int argc, char** argv)
if ( alive_handlers->length() > 0 && dump_used_event_handlers ) if ( alive_handlers->length() > 0 && dump_used_event_handlers )
{ {
reporter->Message("invoked event handlers:"); reporter->Info("invoked event handlers:");
for ( int i = 0; i < alive_handlers->length(); ++i ) for ( int i = 0; i < alive_handlers->length(); ++i )
reporter->Message((*alive_handlers)[i]); reporter->Info((*alive_handlers)[i]);
} }
delete alive_handlers; delete alive_handlers;

View file

@ -5,10 +5,10 @@ module Reporter;
#include "NetVar.h" #include "NetVar.h"
%%} %%}
function Reporter::message%(msg: string%): bool function Reporter::info%(msg: string%): bool
%{ %{
reporter->PushLocation(frame->GetCall()->GetLocationInfo()); reporter->PushLocation(frame->GetCall()->GetLocationInfo());
reporter->Message("%s", msg->CheckString()); reporter->Info("%s", msg->CheckString());
reporter->PopLocation(); reporter->PopLocation();
return new Val(1, TYPE_BOOL); return new Val(1, TYPE_BOOL);
%} %}

View file

@ -1,6 +1,6 @@
reporter_message|init test-message|/da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 8|0.000000 reporter_info|init test-info|/da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 8|0.000000
reporter_warning|init test-warning|/da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 9|0.000000 reporter_warning|init test-warning|/da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 9|0.000000
reporter_error|init test-error|/da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 10|0.000000 reporter_error|init test-error|/da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 10|0.000000
reporter_message|done test-message|/da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 15|0.000000 reporter_info|done test-info|/da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 15|0.000000
reporter_warning|done test-warning|/da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 16|0.000000 reporter_warning|done test-warning|/da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 16|0.000000
reporter_error|done test-error|/da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 17|0.000000 reporter_error|done test-error|/da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 17|0.000000

View file

@ -1,3 +1,3 @@
/da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 52: pre test-message /da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 52: pre test-info
warning in /da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 53: pre test-warning warning in /da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 53: pre test-warning
error in /da/home/robin/bro/seth/testing/btest/.tmp/core.reporter/reporter.bro, line 54: pre test-error error in /da/home/robin/bro/master/testing/btest/.tmp/core.reporter/reporter.bro, line 54: pre test-error

View file

@ -5,14 +5,14 @@
event bro_init() event bro_init()
{ {
Reporter::message("init test-message"); Reporter::info("init test-info");
Reporter::warning("init test-warning"); Reporter::warning("init test-warning");
Reporter::error("init test-error"); Reporter::error("init test-error");
} }
event bro_done() event bro_done()
{ {
Reporter::message("done test-message"); Reporter::info("done test-info");
Reporter::warning("done test-warning"); Reporter::warning("done test-warning");
Reporter::error("done test-error"); Reporter::error("done test-error");
} }
@ -26,7 +26,7 @@ event connection_established(c: connection)
print "established"; print "established";
Reporter::message("processing test-message"); Reporter::info("processing test-info");
Reporter::warning("processing test-warning"); Reporter::warning("processing test-warning");
Reporter::error("processing test-error"); Reporter::error("processing test-error");
first = 0; first = 0;
@ -34,9 +34,9 @@ event connection_established(c: connection)
global f = open_log_file("logger-test"); global f = open_log_file("logger-test");
event reporter_message(t: time, msg: string, location: string) event reporter_info(t: time, msg: string, location: string)
{ {
print f, fmt("reporter_message|%s|%s|%.6f", msg, location, t); print f, fmt("reporter_info|%s|%s|%.6f", msg, location, t);
} }
event reporter_warning(t: time, msg: string, location: string) event reporter_warning(t: time, msg: string, location: string)
@ -49,7 +49,7 @@ event reporter_error(t: time, msg: string, location: string)
print f, fmt("reporter_error|%s|%s|%.6f", msg, location, t); print f, fmt("reporter_error|%s|%s|%.6f", msg, location, t);
} }
Reporter::message("pre test-message"); Reporter::info("pre test-info");
Reporter::warning("pre test-warning"); Reporter::warning("pre test-warning");
Reporter::error("pre test-error"); Reporter::error("pre test-error");