ESPHome 2025.5.0
Loading...
Searching...
No Matches
esphome_syslog.h
Go to the documentation of this file.
1#pragma once
4#include "esphome/core/log.h"
7
8#ifdef USE_NETWORK
9namespace esphome {
10namespace syslog {
11class Syslog : public Component, public Parented<udp::UDPComponent> {
12 public:
13 Syslog(int level, time::RealTimeClock *time) : log_level_(level), time_(time) {}
14 void setup() override;
15 void set_strip(bool strip) { this->strip_ = strip; }
16 void set_facility(int facility) { this->facility_ = facility; }
17
18 protected:
20 void log_(int level, const char *tag, const char *message) const;
22 bool strip_{true};
23 int facility_{16};
24};
25} // namespace syslog
26} // namespace esphome
27#endif
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
void set_facility(int facility)
time::RealTimeClock * time_
void log_(int level, const char *tag, const char *message) const
void set_strip(bool strip)
Syslog(int level, time::RealTimeClock *time)
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7