Files
m-aXimilian c00c2c71ac
MegaLinter / MegaLinter (push) Has been cancelled
CI Workflow / build-ubuntu (push) Has been cancelled
CI Workflow / build-windows (push) Has been cancelled
CI Workflow / generate-docs (push) Has been cancelled
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
2026-02-16 20:36:48 +01:00

50 lines
1.0 KiB
C++

#pragma once
#include <string>
#ifdef _WIN32
#define __PRETTY_FUNCTION__ __FUNCTION__
#endif
namespace pixelarium::utils::log
{
enum class LogLevel
{
kTrace = 1 << 0,
kDebug = 1 << 1,
kInfo = 1 << 2,
kWarn = 1 << 3,
kError = 1 << 4,
};
constexpr auto LogLevelToString(LogLevel lvl) -> std::string
{
switch (lvl)
{
case LogLevel::kTrace:
return "Trace";
case LogLevel::kDebug:
return "Debug";
case LogLevel::kInfo:
return "Info";
case LogLevel::kWarn:
return "Warning";
case LogLevel::kError:
return "Error";
}
}
/// @brief Interface for logging implementations.
class ILog
{
public:
virtual void Info(const std::string& msg) const = 0;
virtual void Debug(const std::string& msg) const = 0;
virtual void Warn(const std::string& msg) const = 0;
virtual void Error(const std::string& msg) const = 0;
virtual void ChangeLevel(LogLevel lvl) const = 0;
virtual ~ILog() {}
};
} // namespace pixelarium::utils::log