mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-05-19 05:57:30 -04:00
Due to losing bytes the logger has a worker which is responsible for dumping logs to the file. The logger also has its own timer to dump logs every 15 minutes. EventManager is not responsible for interval dumping logs now.
36 lines
974 B
C++
36 lines
974 B
C++
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <Service/Worker.hpp>
|
|
|
|
namespace Log
|
|
{
|
|
static constexpr auto workerName = "LoggerWorker";
|
|
|
|
class LoggerWorker : public sys::Worker
|
|
{
|
|
public:
|
|
enum class Signal
|
|
{
|
|
DumpFilledBuffer,
|
|
DumpIntervalBuffer,
|
|
DumpDiagnostic
|
|
};
|
|
|
|
static constexpr auto SignalQueueName = "LoggerSignal";
|
|
static constexpr auto SignalSize = sizeof(Signal);
|
|
static constexpr auto SignalQueueLenght = 1;
|
|
|
|
explicit LoggerWorker(const std::string name);
|
|
void notify(Signal command);
|
|
bool handleMessage(std::uint32_t queueID) override;
|
|
void handleCommand(Signal command);
|
|
|
|
private:
|
|
static constexpr auto priority = static_cast<UBaseType_t>(sys::ServicePriority::Idle);
|
|
};
|
|
|
|
} // namespace Log
|