Commit 56ee7316 authored by gabi's avatar gabi

Fixed issue #39 User defined types no longer streamable

parent d071e5fc
......@@ -23,7 +23,7 @@
/*************************************************************************/
#pragma once
#include <type_traits>
#include "../common.h"
#include "../logger.h"
#ifdef SPDLOG_CLOCK_COARSE
......@@ -96,18 +96,85 @@ public:
}
}
void write(const char* what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(const std::string& what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(int what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(unsigned int what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(long what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(unsigned long what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(long long what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(unsigned long long what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(double what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(long double what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(float what)
{
if (_enabled)
_log_msg.raw << what;
}
void write(char what)
{
if (_enabled)
_log_msg.raw << what;
}
template<typename T>
line_logger& operator<<(const T& what)
{
if (_enabled)
_log_msg.raw << what;
_log_msg.raw.write("{}", what);
return *this;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment