Automatic Curtain  MVP
Software repository for an automatic curtain using stepper motor, TMC2209 and ESP32
logging.h
Go to the documentation of this file.
1 
12 #ifndef _LOGGING_INCLUDE_GUARD
13 #define _LOGGING_INCLUDE_GUARD
14 
15 #include <Arduino.h>
16 
17 #include <mutex>
18 
19 #include "../config/config.h"
20 
21 class Logging {
22  public:
27  Logging(bool logging_status);
28 
33  ~Logging();
34 
43  bool Log(CONFIG_SET::LOG_TYPE log_type, CONFIG_SET::LOG_CLASS log_class, const char* message);
44 
53  bool Log(CONFIG_SET::LOG_TYPE log_type, CONFIG_SET::LOG_CLASS log_class, String message);
54 
60  void SetLoggingStatus(bool status);
61 
67  bool GetLoggingStatus();
68 
69  private:
71  std::mutex status_mutex;
72 };
73 
74 #endif
std::mutex status_mutex
Definition: logging.h:71
bool logging_status_
Definition: logging.h:70
bool GetLoggingStatus()
Get the Logging Status object.
Definition: logging.cpp:89
Definition: logging.h:21
void SetLoggingStatus(bool status)
This function enables or disables logging true: logging enabled false: logging disabled.
Definition: logging.cpp:84
~Logging()
Destroy the Logging object.
Definition: logging.cpp:28
Logging(bool logging_status)
Construct a new Logging object, initializes the serial connection.
Definition: logging.cpp:23
LOG_TYPE
Definition: config.h:114
bool Log(CONFIG_SET::LOG_TYPE log_type, CONFIG_SET::LOG_CLASS log_class, const char *message)
For now, the function will just print a message on serial, it can be over wifi or just hardware seria...
Definition: logging.cpp:32
LOG_CLASS
Definition: config.h:120