[Bro-Dev] [Bro-Commits] [git/bro] topic/robin/reporting: Overhauling the internal reporting of messages to the user. (93894ee)

Robin Sommer robin at icir.org
Mon Jun 27 08:32:40 PDT 2011


On Mon, Jun 27, 2011 at 07:26 -0700, you wrote:

> Can the log_* handlers also write to stderr instead of stdout?

The current implementation is just a placeholder. The output should
probably go into its own log file but I let Seth figure that out. :-)

> It appears that there are several places, esp. in Expr.cc and Stmt.cc  
> that still use the old Error(), Internal(), etc. functions (including  
> the SetError). Is this on purpose?

Yes, these are BroObj's Error() etc. methods; I just removed the
methods in the util.h. Generally, I left object-specific error methods
in because (1) they sometimes do additional things, and (2) it would
have required touching lots of places without making things much
better.

But: these methods used to call error() for doing their output and
*that* has been replaced with Logger::Error().

Let me know if you still find a method logging errors directly to
stderr/out (except for debugging stuff, I didn't touch that, like in
Rule*.cc). 

> I was more wondering what would happen if due to an error the handler  
> for log_error cannot run properly. I.e., whether there can be a case  
> were we don't see any error messages.

Can't think of anything.

> Well, log_error will go in an endless loop and continue to queue events.

Hmm, that's right. I forgot that we aren't limiting how many events we
process each time we drain the manager (we do limit timers per
packet). Seems that should be caught and errors reported in a
log_error hanlder be written out to stderr.


Another question: what do you guys think about merging Logger and
LogMgr now? I.e., let LogMgr do both error reporting and normal log
output.

Robin


-- 
Robin Sommer * Phone +1 (510) 722-6541 * robin at icir.org
ICSI/LBNL    * Fax   +1 (510) 666-2956 *   www.icir.org


More information about the bro-dev mailing list