esp32cam
OV2640 camera on ESP32-CAM
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
6 namespace esp32cam {
7 
8 extern Print* LogOutput;
9 
14 inline void
15 setLogger(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: camera.cpp:6
Print * LogOutput
Definition: camera.cpp:8
void setLogger(Print &output)
Set logger output.
Definition: logger.hpp:15