mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 19:42:08 +02:00

* Add Logging class Add Logging class which inherits from Print class, to be able to route logging to USB Serial or to memory for display in the webpage. Adds a log webpage only visible when DEBUG_VIA_WEB is defined.
16 lines
338 B
C++
16 lines
338 B
C++
#ifndef __LOGGING_H__
|
|
#define __LOGGING_H__
|
|
|
|
#include <inttypes.h>
|
|
#include "Print.h"
|
|
|
|
class Logging : public Print {
|
|
public:
|
|
virtual size_t write(const uint8_t* buffer, size_t size);
|
|
virtual size_t write(uint8_t) { return 0; }
|
|
void printf(const char* fmt, ...);
|
|
Logging() {}
|
|
};
|
|
|
|
extern Logging logging;
|
|
#endif // __LOGGING_H__
|