c00c2c71ac
* scratch adding histogram to image views Histograms should come from some sort of histogram service. This is currently just a POC. * custom logger implementation w/o spdlog * missing cmake file * fix tests * use operator<< over direct stream exposure * rm print header * add threading test + refactor towards interface libraries omits the need for =target_include_directories= calls /everywhere/ * rm print header * rm constexpr * templated thread_pool * fix doxyfile * default enable doc building * czi reader refactor * rm erroneous include expression * clang-format * single lib include with PUBLIC visibility * compile imgui stdlib * clang format * documentation update centralize `LogLevelToString` to `ILog.hpp` update docs and examples
37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <mutex>
|
|
#include <string>
|
|
|
|
#include "ILog.hpp"
|
|
|
|
namespace pixelarium::utils::log
|
|
{
|
|
class PixelariumLogger : public ILog
|
|
{
|
|
private:
|
|
struct LogStream;
|
|
|
|
public:
|
|
explicit PixelariumLogger(const std::string& name, const std::string& file_sink);
|
|
~PixelariumLogger();
|
|
|
|
void Info(const std::string& msg) const override { this->Write(LogLevel::kInfo, msg); }
|
|
void Debug(const std::string& msg) const override { this->Write(LogLevel::kDebug, msg); }
|
|
void Warn(const std::string& msg) const override { this->Write(LogLevel::kWarn, msg); }
|
|
void Error(const std::string& msg) const override { this->Write(LogLevel::kError, msg); }
|
|
void ChangeLevel(LogLevel lvl) const override { this->level_ = lvl; }
|
|
|
|
private:
|
|
void Write(LogLevel, const std::string&) const;
|
|
|
|
private:
|
|
std::mutex mutable mutex_;
|
|
std::string name_;
|
|
std::string file_sink_;
|
|
std::unique_ptr<LogStream> log_stream_{};
|
|
LogLevel mutable level_{LogLevel::kDebug};
|
|
};
|
|
} // namespace pixelarium::utils::log
|