mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00
Merge remote branch 'origin/topic/robin/logging-internals'
Includes some additional cleanup.
This commit is contained in:
commit
13a492091f
119 changed files with 5266 additions and 183 deletions
76
src/logging.bif
Normal file
76
src/logging.bif
Normal file
|
@ -0,0 +1,76 @@
|
|||
# Internal functions and types used by the logging framework.
|
||||
|
||||
module Log;
|
||||
|
||||
%%{
|
||||
#include "LogMgr.h"
|
||||
#include "NetVar.h"
|
||||
%%}
|
||||
|
||||
type Filter: record;
|
||||
type Stream: record;
|
||||
type RotationInfo: record;
|
||||
type RotationControl: record;
|
||||
|
||||
const Log::rotation_control: RotationControl;
|
||||
|
||||
function Log::__create_stream%(id: Log::ID, stream: Log::Stream%) : bool
|
||||
%{
|
||||
bool result = log_mgr->CreateStream(id->AsEnumVal(), stream->AsRecordVal());
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
function Log::__enable_stream%(id: Log::ID%) : bool
|
||||
%{
|
||||
bool result = log_mgr->EnableStream(id->AsEnumVal());
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
function Log::__disable_stream%(id: Log::ID%) : bool
|
||||
%{
|
||||
bool result = log_mgr->DisableStream(id->AsEnumVal());
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
function Log::__add_filter%(id: Log::ID, filter: Log::Filter%) : bool
|
||||
%{
|
||||
bool result = log_mgr->AddFilter(id->AsEnumVal(), filter->AsRecordVal());
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
function Log::__remove_filter%(id: Log::ID, name: string%) : bool
|
||||
%{
|
||||
bool result = log_mgr->RemoveFilter(id->AsEnumVal(), name);
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
function Log::__write%(id: Log::ID, columns: any%) : bool
|
||||
%{
|
||||
bool result = log_mgr->Write(id->AsEnumVal(), columns->AsRecordVal());
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
function Log::__set_buf%(id: Log::ID, buffered: bool%): bool
|
||||
%{
|
||||
bool result = log_mgr->SetBuf(id->AsEnumVal(), buffered);
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
function Log::__flush%(id: Log::ID%): bool
|
||||
%{
|
||||
bool result = log_mgr->Flush(id->AsEnumVal());
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
# Options for the ASCII writer.
|
||||
|
||||
module LogAscii;
|
||||
|
||||
const output_to_stdout: bool;
|
||||
const include_header: bool;
|
||||
const header_prefix: string;
|
||||
const separator: string;
|
||||
const set_separator: string;
|
||||
const empty_field: string;
|
||||
const unset_field: string;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue