Files
MuditaOS/module-utils/log/LoggerBuffer.hpp
Lefucjusz 773f2c7eb1 [BH-2069] Update license URL in headers
Update outdated license file URL in
license headers across all project.
2024-09-18 11:53:01 +02:00

25 lines
610 B
C++

// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/blob/master/LICENSE.md
#pragma once
#include "StringCircularBuffer.hpp"
class LoggerBuffer : public StringCircularBuffer
{
public:
explicit LoggerBuffer(size_t size) : StringCircularBuffer(size)
{}
[[nodiscard]] std::optional<std::string> get();
void put(const std::string &logMsg);
void put(std::string &&logMsg);
static constexpr auto lostBytesMessage = "bytes were lost.";
private:
void updateNumOfLostBytes();
size_t numOfLostBytes{0};
};