[Bro-Dev] #675: enum values in log output can be ambitious

Bro Tracker bro at tracker.bro-ids.org
Thu Dec 1 09:08:09 PST 2011


#675: enum values in log output can be ambitious
---------------------------+--------------------
  Reporter:  robin         |      Owner:
      Type:  Problem       |     Status:  closed
  Priority:  Normal        |  Milestone:  Bro2.0
 Component:  Bro           |    Version:
Resolution:  Works for Me  |   Keywords:
---------------------------+--------------------
Changes (by seth):

 * status:  new => closed
 * resolution:   => Works for Me


Comment:

 Enums are always written out fully expanded (logging framework and plain
 print).  You changed this behavior for me a while ago because I was
 running into trouble with them not being expanded.  Here's an example I
 wrote:

 {{{
 module Other;

 export {
         type MyEnum: enum { blue };
 }

 module M1;

 export {
         redef enum Other::MyEnum += { green };
 }

 module M2;

 export {
         redef enum Other::MyEnum += { green };
 }

 module Mine;

 export {
         redef enum Log::ID += { LOG };

         type Info: record {
                 enum_val: Other::MyEnum &log;
         };
 }

 event bro_init()
         {
         Log::create_stream(Mine::LOG, [$columns=Info]);
         Log::write(Mine::LOG, [$enum_val=M2::green]);
         }
 }}}

 This output a file name mine.log with these contents:

 {{{
 #separator \x09
 #path   mine
 #fields enum_val
 #types  enum
 M2::green
 }}}

 The only additional change I can think of is that we probably need to
 indicate which enum type the value is in the headers but I think Bernhard
 has already addressed that in the input framework branch.

-- 
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/675#comment:1>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list