opuntiaOS - an operating system targeting x86 and ARMv7
at master 589 B view raw
1#include <libfoundation/helpers/LoggerStreamBuf.h> 2#include <ostream> 3 4namespace LFoundation { 5 6namespace Logger { 7 _ALIGNAS_TYPE(std::ostream) 8 char debug[sizeof(std::ostream)]; 9 _ALIGNAS_TYPE(std::ostream) 10 char info[sizeof(std::ostream)]; 11 _ALIGNAS_TYPE(std::ostream) 12 char error[sizeof(std::ostream)]; 13}; 14 15class LoggerInit final { 16public: 17 LoggerInit() 18 { 19 m_ldebug_ptr = new (Logger::debug) std::ostream(new Logger::StreamBuf(stdout)); 20 }; 21 22 ~LoggerInit() 23 { 24 } 25 26private: 27 std::ostream* m_ldebug_ptr; 28}; 29 30static LoggerInit logger_init; 31 32}