mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Reformat the world
This commit is contained in:
parent
194cb24547
commit
b2f171ec69
714 changed files with 35149 additions and 35203 deletions
|
@ -6,21 +6,28 @@
|
|||
|
||||
#include <string_view>
|
||||
|
||||
#include "zeek/Val.h"
|
||||
#include "zeek/Tag.h"
|
||||
#include "zeek/EventHandler.h"
|
||||
#include "zeek/plugin/ComponentManager.h"
|
||||
|
||||
#include "zeek/Tag.h"
|
||||
#include "zeek/Val.h"
|
||||
#include "zeek/logging/Component.h"
|
||||
#include "zeek/logging/WriterBackend.h"
|
||||
#include "zeek/plugin/ComponentManager.h"
|
||||
|
||||
namespace broker { struct endpoint_info; }
|
||||
namespace broker
|
||||
{
|
||||
struct endpoint_info;
|
||||
}
|
||||
|
||||
namespace zeek {
|
||||
namespace zeek
|
||||
{
|
||||
|
||||
namespace detail { class SerializationFormat; }
|
||||
namespace detail
|
||||
{
|
||||
class SerializationFormat;
|
||||
}
|
||||
|
||||
namespace logging {
|
||||
namespace logging
|
||||
{
|
||||
|
||||
class WriterFrontend;
|
||||
class RotationFinishedMessage;
|
||||
|
@ -29,9 +36,9 @@ class RotationTimer;
|
|||
/**
|
||||
* Singleton class for managing log streams.
|
||||
*/
|
||||
class Manager : public plugin::ComponentManager<Tag, Component> {
|
||||
class Manager : public plugin::ComponentManager<Tag, Component>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
|
@ -55,10 +62,8 @@ public:
|
|||
* @param rotation_info The fields of a Log::RotationFmtInfo record
|
||||
* to create and pass to Log::rotation_format_func.
|
||||
*/
|
||||
std::string FormatRotationPath(EnumValPtr writer,
|
||||
std::string_view path, double open,
|
||||
double close, bool terminating,
|
||||
FuncPtr postprocesor);
|
||||
std::string FormatRotationPath(EnumValPtr writer, std::string_view path, double open,
|
||||
double close, bool terminating, FuncPtr postprocesor);
|
||||
|
||||
/**
|
||||
* Creates a new log stream.
|
||||
|
@ -189,8 +194,8 @@ public:
|
|||
* @param vals An array of log values to write, of size num_fields.
|
||||
* The method takes ownership of the array.
|
||||
*/
|
||||
bool WriteFromRemote(EnumVal* stream, EnumVal* writer, const std::string& path,
|
||||
int num_fields, threading::Value** vals);
|
||||
bool WriteFromRemote(EnumVal* stream, EnumVal* writer, const std::string& path, int num_fields,
|
||||
threading::Value** vals);
|
||||
|
||||
/**
|
||||
* Announces all instantiated writers to a given Broker peer.
|
||||
|
@ -264,9 +269,9 @@ protected:
|
|||
|
||||
// Takes ownership of fields and info.
|
||||
WriterFrontend* CreateWriter(EnumVal* id, EnumVal* writer, WriterBackend::WriterInfo* info,
|
||||
int num_fields, const threading::Field* const* fields,
|
||||
bool local, bool remote, bool from_remote,
|
||||
const std::string& instantiating_filter="");
|
||||
int num_fields, const threading::Field* const* fields, bool local,
|
||||
bool remote, bool from_remote,
|
||||
const std::string& instantiating_filter = "");
|
||||
|
||||
// Signals that a file has been rotated.
|
||||
bool FinishedRotation(WriterFrontend* writer, const char* new_name, const char* old_name,
|
||||
|
@ -280,12 +285,10 @@ private:
|
|||
struct Stream;
|
||||
struct WriterInfo;
|
||||
|
||||
bool TraverseRecord(Stream* stream, Filter* filter, RecordType* rt,
|
||||
TableVal* include, TableVal* exclude,
|
||||
const std::string& path, const std::list<int>& indices);
|
||||
bool TraverseRecord(Stream* stream, Filter* filter, RecordType* rt, TableVal* include,
|
||||
TableVal* exclude, const std::string& path, const std::list<int>& indices);
|
||||
|
||||
threading::Value** RecordToFilterVals(Stream* stream, Filter* filter,
|
||||
RecordVal* columns);
|
||||
threading::Value** RecordToFilterVals(Stream* stream, Filter* filter, RecordVal* columns);
|
||||
|
||||
threading::Value* ValToLogVal(Val* val, Type* ty = nullptr);
|
||||
Stream* FindStream(EnumVal* id);
|
||||
|
@ -296,14 +299,14 @@ private:
|
|||
bool CompareFields(const Filter* filter, const WriterFrontend* writer);
|
||||
bool CheckFilterWriterConflict(const WriterInfo* winfo, const Filter* filter);
|
||||
|
||||
std::vector<Stream *> streams; // Indexed by stream enum.
|
||||
int rotations_pending; // Number of rotations not yet finished.
|
||||
std::vector<Stream*> streams; // Indexed by stream enum.
|
||||
int rotations_pending; // Number of rotations not yet finished.
|
||||
FuncPtr rotation_format_func;
|
||||
FuncPtr log_stream_policy_hook;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace logging;
|
||||
} // namespace logging;
|
||||
|
||||
extern logging::Manager* log_mgr;
|
||||
|
||||
} // namespace zeek
|
||||
} // namespace zeek
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue