Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
logging.h
Go to the documentation of this file.
1#pragma once
2
3#include <spdlog/sinks/stdout_color_sinks.h>
4
5#include <filesystem>
6#include <memory>
7
8#include "config.h"
9#include "ring_log_sink.h"
10
17
18namespace mm {
19
21struct LogSinks {
23 std::shared_ptr<RingLogSinkMt> ring;
24 std::shared_ptr<spdlog::sinks::stdout_color_sink_mt> console;
25};
26
34
43std::filesystem::path applyLoggingConfig(const LogSinks& sinks, const LoggingConfig& config,
44 const std::filesystem::path& userCacheRoot);
45
46} // namespace mm
Definition auto_tuning_setup.cc:10
LogSinks installLogSinks()
Replaces the default logger with a console sink plus the in-memory ring.
Definition logging.cc:14
std::filesystem::path applyLoggingConfig(const LogSinks &sinks, const LoggingConfig &config, const std::filesystem::path &userCacheRoot)
Applies the configured levels and adds the rotating file sink.
Definition logging.cc:24
"logging" block — verbosity and the log file.
Definition config.h:189
The two sinks that exist before any configuration is read.
Definition logging.h:21
std::shared_ptr< spdlog::sinks::stdout_color_sink_mt > console
Definition logging.h:24
std::shared_ptr< RingLogSinkMt > ring
Backs GET /api/log. The HTTP server borrows it for the lifetime of the process.
Definition logging.h:23