Checkpoint for logging framework

This commit is contained in:
Seth Hall 2011-01-19 09:36:06 -05:00
parent aa0691ba21
commit f3b148b019
5 changed files with 139 additions and 1 deletions

View file

@ -1336,7 +1336,9 @@ static int is_init_compat(const BroType* t1, const BroType* t2)
int same_type(const BroType* t1, const BroType* t2, int is_init)
{
if ( t1 == t2 )
if ( t1 == t2 ||
t1->Tag() == TYPE_ANY ||
t2->Tag() == TYPE_ANY )
return 1;
t1 = flatten_type(t1);

View file

@ -3300,6 +3300,10 @@ Val* check_and_promote(Val* v, const BroType* t, int is_init)
TypeTag t_tag = t->Tag();
TypeTag v_tag = vt->Tag();
// More thought definitely needs to go into this.
if ( t_tag == TYPE_ANY || v_tag == TYPE_ANY )
return v;
if ( ! EitherArithmetic(t_tag, v_tag) ||
/* allow sets as initializers */

View file

@ -359,6 +359,18 @@ function cat%(...%): string
return new StringVal(s);
%}
function logging_log%(id: Logging_ID, rec: any%): bool
%{
// Generate the log line event
// Lookup the log file
TableVal *f = opt_internal_table("Logging::filters");
TableVal *s = f->Lookup(id, 0)->AsTableVal();
// For each filter on 'id'
// Format the output
// Print the line
%}
function cat_sep%(sep: string, def: string, ...%): string
%{