esp32cam
OV2640 camera on ESP32-CAM
Loading...
Searching...
No Matches
logger.hpp
Go to the documentation of this file.
1#ifndef ESP32CAM_LOGGER_HPP
2#define ESP32CAM_LOGGER_HPP
3
4#include <Arduino.h>
5
6namespace esp32cam {
7
8extern Print* LogOutput;
9
14inline void
15setLogger(Print& output) {
16 LogOutput = &output;
17}
18
19#define ESP32CAM_LOG(fmt, ...) \
20 do { \
21 if (LogOutput != nullptr) { \
22 LogOutput->printf("[%8lu] " fmt "\n", millis(), ##__VA_ARGS__); \
23 } \
24 } while (false)
25
26} // namespace esp32cam
27
28#endif // ESP32CAM_LOGGER_HPP
Definition esp32cam.h:14
Print * LogOutput
Definition camera.cpp:8
void setLogger(Print &output)
Set logger output.
Definition logger.hpp:15