Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::log_notifier Class Reference

Simple notifier that logs alerts. More...

#include <alert_manager.h>

Inheritance diagram for kcenon::monitoring::log_notifier:
Inheritance graph
Collaboration diagram for kcenon::monitoring::log_notifier:
Collaboration graph

Public Member Functions

 log_notifier (std::string notifier_name="log_notifier")
 Construct log notifier.
 
std::string name () const override
 Get the name of this log notifier.
 
common::VoidResult notify (const alert &a) override
 Log an alert notification.
 
common::VoidResult notify_group (const alert_group &group) override
 Log a grouped alert notification.
 
bool is_ready () const override
 Check if the log notifier is ready.
 
- Public Member Functions inherited from kcenon::monitoring::alert_notifier
virtual ~alert_notifier ()=default
 

Private Attributes

std::string name_
 

Detailed Description

Simple notifier that logs alerts.

Writes alert information to the logging system.

Definition at line 446 of file alert_manager.h.

Constructor & Destructor Documentation

◆ log_notifier()

kcenon::monitoring::log_notifier::log_notifier ( std::string notifier_name = "log_notifier")
inlineexplicit

Construct log notifier.

Parameters
notifier_nameName for this notifier
Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/alert/alert_manager.h.

Definition at line 452 of file alert_manager.h.

453 : name_(std::move(notifier_name)) {}

Member Function Documentation

◆ is_ready()

bool kcenon::monitoring::log_notifier::is_ready ( ) const
inlineoverridevirtual

Check if the log notifier is ready.

Returns
Always returns true since logging is always available

Implements kcenon::monitoring::alert_notifier.

Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/alert/alert_manager.h.

Definition at line 479 of file alert_manager.h.

479{ return true; }

Referenced by TEST().

Here is the caller graph for this function:

◆ name()

std::string kcenon::monitoring::log_notifier::name ( ) const
inlineoverridevirtual

Get the name of this log notifier.

Returns
The notifier name string

Implements kcenon::monitoring::alert_notifier.

Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/alert/alert_manager.h.

Definition at line 459 of file alert_manager.h.

459{ return name_; }

References name_.

Referenced by TEST(), and TEST().

Here is the caller graph for this function:

◆ notify()

common::VoidResult kcenon::monitoring::log_notifier::notify ( const alert & a)
overridevirtual

Log an alert notification.

Parameters
aAlert to log
Returns
Result indicating success or failure

Implements kcenon::monitoring::alert_notifier.

Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/alert/alert_manager.h.

◆ notify_group()

common::VoidResult kcenon::monitoring::log_notifier::notify_group ( const alert_group & group)
overridevirtual

Log a grouped alert notification.

Parameters
groupAlert group to log
Returns
Result indicating success or failure

Implements kcenon::monitoring::alert_notifier.

Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/alert/alert_manager.h.

Member Data Documentation

◆ name_

std::string kcenon::monitoring::log_notifier::name_
private

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