A C++ library for logging very fast and without allocating.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

16 wiersze
360 B

#include <span>
#include "sl/logger.h"
#include "registry.h"
namespace sl {
void log(int log_id, std::string line) {
auto& slab = registry_map.at(log_id);
auto token = slab.reserve_write(line.size());
auto span = slab.get_buffer(token);
for(auto elem : line) {
span.front() = elem;
span = span.subspan(1);
}
slab.conclude_write(token);
}
}