#ifndef LIBRARY_LOG_HPP #define LIBRARY_LOG_HPP #include #include namespace vkvm { enum LogLevel{ DEBUG = 1, INFO = 2, WARNING = 3, ERROR = 4, CRITICAL = 5, OFF = 6 }; /** * log the messgae with logLevel and timestamp * @author Julian Hinxlage * @since 0.1.0 */ auto log(LogLevel level, const std::string &msg) -> void; template static auto buildString(std::stringstream &stream, T t) -> void { stream << t; } template static auto buildString(std::stringstream &stream, T t, Ts... ts) -> void { stream << t; buildString(stream, ts...); } template static auto log(LogLevel level, T... t) -> void { std::stringstream stream; buildString(stream, t...); log(level, stream.str()); } /** * set the logLevel, the log function will use this to determine if the message is logged * @author Julian Hinxlage * @since 0.1.0 */ auto setLogLevel(LogLevel level) -> void; } #endif