Yarilo v0.9.9
WPA2 Decrypter & Packet Analyzer
Loading...
Searching...
No Matches
yarilo::log::ProtoSink< Mutex > Class Template Reference

A sink for logging messages in a protobuf format. More...

#include <log_sink.h>

Inheritance diagram for yarilo::log::ProtoSink< Mutex >:

Public Member Functions

 ProtoSink (uint64_t max_entries=50)
 Constructs a ProtoSink with a maximum number of entries.
 
 ~ProtoSink () override=default
 
std::vector< proto::LogEntry * > get_entries ()
 Retrieves all log entries from the sink. This method locks the sink, fetches all entries, and returns them.
 
void stop ()
 Stops the sink and all waiting clients.
 
bool is_stopped ()
 Checks if the sink is stopped.
 

Protected Member Functions

void sink_it_ (const spdlog::details::log_msg &msg) override
 Processes and stores a log message.
 
void flush_ () override
 

Detailed Description

template<typename Mutex>
class yarilo::log::ProtoSink< Mutex >

A sink for logging messages in a protobuf format.

This class is a template-based sink that can be used with different types of mutexes (standard or null mutex). It stores log entries in a queue and provides access to the stored entries.

Template Parameters
MutexThe type of mutex used for thread-safety.

Constructor & Destructor Documentation

◆ ProtoSink()

template<typename Mutex >
yarilo::log::ProtoSink< Mutex >::ProtoSink ( uint64_t max_entries = 50)
inline

Constructs a ProtoSink with a maximum number of entries.

Parameters
[in]max_entriesMaximum number of log entries to store in the queue.

◆ ~ProtoSink()

template<typename Mutex >
yarilo::log::ProtoSink< Mutex >::~ProtoSink ( )
overridedefault

Member Function Documentation

◆ flush_()

template<typename Mutex >
void yarilo::log::ProtoSink< Mutex >::flush_ ( )
inlineoverrideprotected

◆ get_entries()

template<typename Mutex >
std::vector< proto::LogEntry * > yarilo::log::ProtoSink< Mutex >::get_entries ( )
inline

Retrieves all log entries from the sink. This method locks the sink, fetches all entries, and returns them.

Returns
A vector of pointers to log entries stored in the queue.

◆ is_stopped()

template<typename Mutex >
bool yarilo::log::ProtoSink< Mutex >::is_stopped ( )
inline

Checks if the sink is stopped.

Returns
True if the sink is stopped.

◆ sink_it_()

template<typename Mutex >
void yarilo::log::ProtoSink< Mutex >::sink_it_ ( const spdlog::details::log_msg & msg)
inlineoverrideprotected

Processes and stores a log message.

Parameters
[in]msgThe log message to be processed.

◆ stop()

template<typename Mutex >
void yarilo::log::ProtoSink< Mutex >::stop ( )
inline

Stops the sink and all waiting clients.


The documentation for this class was generated from the following file: