mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Checkpoint for logging framework
This commit is contained in:
parent
aa0691ba21
commit
f3b148b019
5 changed files with 139 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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 */
|
||||
|
|
12
src/bro.bif
12
src/bro.bif
|
@ -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
|
||||
%{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue