cleanup of source + build system

* seperated most parts into headers & source files
* seperated anthracite into libanthracite and anthracite-bin for modules
* built demo webAPI module
* rewrote some code to do things in the
* changed cmakelists to not build in src directory
This commit is contained in:
Nicholas Orlowsky 2025-02-04 02:03:27 -05:00
parent c4540a1397
commit 54d82b8c66
Signed by: nickorlow
GPG key ID: 838827D8C4611687
26 changed files with 607 additions and 378 deletions

24
src/log/log.cpp Normal file
View file

@ -0,0 +1,24 @@
#pragma once
#include "./log.hpp"
namespace anthracite::log {
enum LOG_LEVEL Logger::_level = LOG_LEVEL_NONE;
// TODO: implement logger as a singleton to prevent duplicates
Logger::Logger() = default;
void Logger::initialize(enum LOG_LEVEL level) {
_level = level;
}
LogBuf::LogBuf(std::ostream& output_stream, const std::string& tag, enum LOG_LEVEL level) : _output_stream(output_stream), _tag(tag), _level(level) {}
int LogBuf::sync() {
if (this->_level <= logger._level) {
std::cout << "[" << this ->_tag << "] " << this->str();
std::cout.flush();
}
this->str("");
return 0;
}
};