logger small changes
This commit is contained in:
parent
e2ae2b7fc2
commit
160a1365f3
2
Makefile
2
Makefile
@ -10,7 +10,7 @@ OS = linux
|
||||
|
||||
# C++ compier
|
||||
CXX = g++
|
||||
CXXFLAGS = -MMD -c -g -Og -Wall -Werror -std=c++11 -Iinclude -Isrc/asm/include #-fsanitize=thread -fPIE
|
||||
CXXFLAGS = -MMD -c -g -Og -Wall -Werror -std=c++11 -Iinclude -Isrc/asm/include -fno-strict-aliasing #-fsanitize=thread -fPIE
|
||||
LDFLAGS = -lgtest #-ltsan -pie
|
||||
|
||||
# Archiver
|
||||
|
||||
@ -23,19 +23,23 @@ public:
|
||||
|
||||
template<typename... Args> void log(const char* s, const Args&... args)
|
||||
{
|
||||
std::cout << "step 1" << std::endl;
|
||||
//const long time = std::chrono::high_resolution_clock::now().time_since_epoch().count();
|
||||
|
||||
if(_enabled)
|
||||
{
|
||||
std::cout << "step 2" << std::endl;
|
||||
_queue.add_log([this, s, args...] {
|
||||
std::cout << "step 3" << std::endl;
|
||||
_logLine.str("");
|
||||
log_internal(s, args...);
|
||||
});
|
||||
const std::function<void()>& func = std::bind(&logger::log_impl<Args...>, this, s, args...);
|
||||
_queue.add_log(func);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
template<typename... Args> void log_impl(const char* s, const Args&... args)
|
||||
{
|
||||
_logLine.str("");
|
||||
log_internal(s, args...);
|
||||
}
|
||||
|
||||
void log_internal(const char* s);
|
||||
|
||||
template<typename T, typename... Args> void log_internal(const char* s, const T& value, const Args&... args)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user