Skip to content

Commit

Permalink
v3.1.2 (MYCILA_LOGGER_BUFFER_SIZE)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed May 20, 2024
1 parent 2fbbb6d commit 9cf8007
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MycilaLogger",
"version": "3.1.1",
"version": "3.1.2",
"description": "A simple and efficient logging library",
"keywords": "logging",
"homepage": "https://github.com/mathieucarbou/MycilaLogger",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=MycilaLogger
version=3.1.1
version=3.1.2
author=Mathieu Carbou <mathieu.carbou@gmail.com>
maintainer=Mathieu Carbou <mathieu.carbou@gmail.com>
sentence=A simple and efficient logging library
Expand Down
13 changes: 9 additions & 4 deletions src/MycilaLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
#include <esp32-hal-log.h>
#include <vector>

#define MYCILA_LOGGER_VERSION "3.1.1"
#define MYCILA_LOGGER_VERSION_MAJOR 3
#define MYCILA_LOGGER_VERSION_MINOR 1
#define MYCILA_LOGGER_VERSION_REVISION 1
#define MYCILA_LOGGER_VERSION "3.1.2"
#define MYCILA_LOGGER_VERSION_MAJOR 3
#define MYCILA_LOGGER_VERSION_MINOR 1
#define MYCILA_LOGGER_VERSION_REVISION 2

#ifndef MYCILA_LOGGER_BUFFER_SIZE
#define MYCILA_LOGGER_BUFFER_SIZE 256
#endif

namespace Mycila {
class LoggerBuffer : public Print {
public:
LoggerBuffer() { _buffer.reserve(MYCILA_LOGGER_BUFFER_SIZE); };
size_t write(const uint8_t* p, size_t n) override { return _buffer.concat(reinterpret_cast<const char*>(p), n) ? n : 0; }
size_t write(uint8_t c) override { return _buffer.concat(static_cast<char>(c)) ? 1 : 0; }
const String& buffer() const { return _buffer; }
Expand Down

0 comments on commit 9cf8007

Please sign in to comment.