xieite::logger {}

Defined in header <xieite/io/logger.hpp>

Logging utilities. Text is only colored when printing to a TTY.


Contents

#info
template<typename... Args>
struct info { /* ??? */ };

template<typename... Args>
info(std::format_string<Args...>, Args&&...) -> info<Args...>;

template<typename... Args>
info(std::FILE*, std::format_string<Args...>, Args&&...) -> info<Args...>;
Uses an 'INFO' prefix.

#warn
template<typename... Args>
struct warn { /* ??? */ };

template<typename... Args>
warn(std::format_string<Args...>, Args&&...) -> warn<Args...>;

template<typename... Args>
warn(std::FILE*, std::format_string<Args...>, Args&&...) -> warn<Args...>;
Uses a 'WARN' prefix.

#error
template<typename... Args>
struct error { /* ??? */ };

template<typename... Args>
error(std::format_string<Args...>, Args&&...) -> error<Args...>;

template<typename... Args>
error(std::FILE*, std::format_string<Args...>, Args&&...) -> error<Args...>;
Uses an 'ERROR' prefix.


Example

int main() {
	xieite::logger::info("Hello, world!");
	xieite::logger::warn("Hello, world!");
	xieite::logger::error("Hello, world!");
}
Possible output:
INFO  [1969-12-31 23:59:59] main.cpp:int main():417: Hello, world!
WARN  [1970-01-01 00:00:00] main.cpp:int main():418: Hello, world!
ERROR [1970-01-01 00:00:01] main.cpp:int main():419: Hello, world!
[View in Compiler Explorer]