mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
65 lines
1.6 KiB
C++
65 lines
1.6 KiB
C++
##! Internal functions and types used by the logging framework.
|
|
|
|
module Log;
|
|
|
|
%%{
|
|
#include "logging/Manager.h"
|
|
%%}
|
|
|
|
type Filter: record;
|
|
type Stream: record;
|
|
type RotationInfo: record;
|
|
|
|
function Log::__create_stream%(id: Log::ID, stream: Log::Stream%) : bool
|
|
%{
|
|
bool result = log_mgr->CreateStream(id->AsEnumVal(), stream->AsRecordVal());
|
|
return val_mgr->GetBool(result);
|
|
%}
|
|
|
|
function Log::__remove_stream%(id: Log::ID%) : bool
|
|
%{
|
|
bool result = log_mgr->RemoveStream(id->AsEnumVal());
|
|
return val_mgr->GetBool(result);
|
|
%}
|
|
|
|
function Log::__enable_stream%(id: Log::ID%) : bool
|
|
%{
|
|
bool result = log_mgr->EnableStream(id->AsEnumVal());
|
|
return val_mgr->GetBool(result);
|
|
%}
|
|
|
|
function Log::__disable_stream%(id: Log::ID%) : bool
|
|
%{
|
|
bool result = log_mgr->DisableStream(id->AsEnumVal());
|
|
return val_mgr->GetBool(result);
|
|
%}
|
|
|
|
function Log::__add_filter%(id: Log::ID, filter: Log::Filter%) : bool
|
|
%{
|
|
bool result = log_mgr->AddFilter(id->AsEnumVal(), filter->AsRecordVal());
|
|
return val_mgr->GetBool(result);
|
|
%}
|
|
|
|
function Log::__remove_filter%(id: Log::ID, name: string%) : bool
|
|
%{
|
|
bool result = log_mgr->RemoveFilter(id->AsEnumVal(), name);
|
|
return val_mgr->GetBool(result);
|
|
%}
|
|
|
|
function Log::__write%(id: Log::ID, columns: any%) : bool
|
|
%{
|
|
bool result = log_mgr->Write(id->AsEnumVal(), columns->AsRecordVal());
|
|
return val_mgr->GetBool(result);
|
|
%}
|
|
|
|
function Log::__set_buf%(id: Log::ID, buffered: bool%): bool
|
|
%{
|
|
bool result = log_mgr->SetBuf(id->AsEnumVal(), buffered);
|
|
return val_mgr->GetBool(result);
|
|
%}
|
|
|
|
function Log::__flush%(id: Log::ID%): bool
|
|
%{
|
|
bool result = log_mgr->Flush(id->AsEnumVal());
|
|
return val_mgr->GetBool(result);
|
|
%}
|