build system and module refactoring + simple histogram scratch (#20)
* 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
This commit is contained in:
committed by
Maximilian Kueffner
parent
b37814204f
commit
c00c2c71ac
@@ -0,0 +1,36 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user