ESPHome 2026.10.2
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::syslog {
14
15class Syslog final : public Component, public Parented<udp::UDPComponent> {
16 public:
17 Syslog(int level, time::RealTimeClock *time) : log_level_(level), time_(time) {}
18 void setup() override;
19 void on_log(uint8_t level, const char *tag, const char *message, size_t message_len);
20 void set_strip(bool strip) { this->strip_ = strip; }
21 void set_facility(int facility) { this->facility_ = facility; }
23
24 protected:
26 void log_(int level, const char *tag, const char *message, size_t message_len) const;
28 bool strip_{true};
29 int facility_{16};
31};
32} // namespace esphome::syslog
33#endif
Helper class to easily give an object a parent of type T.
Definition helpers.h:2004
void set_facility(int facility)
time::RealTimeClock * time_
void set_format(SyslogFormat format)
void log_(int level, const char *tag, const char *message, size_t message_len) const
void on_log(uint8_t level, const char *tag, const char *message, size_t message_len)
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.
const LogString * message
Definition component.cpp:35
const char * format