supla-device
Loading...
Searching...
No Matches
debug_log.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_DEBUG_DEBUG_LOG_H_
5#define SRC_SUPLA_DEBUG_DEBUG_LOG_H_
6
7#include <stdint.h>
8
9#include <supla/debug/debug_config.h>
10
11#ifdef __cplusplus
12namespace Supla {
13namespace Debug {
14
15class LogSink {
16 public:
17 virtual ~LogSink() = default;
18 virtual void writeLog(int priority, const char *message) = 0;
19};
20
21void setLogSink(LogSink *sink);
22void clearLogSink(LogSink *sink);
23void writeLog(int priority, const char *message);
24const char *logPriorityPrefix(int priority);
25
26} // namespace Debug
27} // namespace Supla
28
29extern "C" void supla_debug_log_write(int priority, const char *message);
30extern "C" void supla_debug_logf(int priority, const char *format, ...);
31#else
32void supla_debug_log_write(int priority, const char *message);
33void supla_debug_logf(int priority, const char *format, ...);
34#endif
35
36#endif // SRC_SUPLA_DEBUG_DEBUG_LOG_H_