mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
DEPRECATED: operator<< API
This commit is contained in:
@@ -11,7 +11,7 @@ std::string log_info(const T& what, spdlog::level::level_enum logger_level = spd
|
||||
spdlog::logger oss_logger("oss", oss_sink);
|
||||
oss_logger.set_level(logger_level);
|
||||
oss_logger.set_pattern("%v");
|
||||
oss_logger.info() << what;
|
||||
oss_logger.info(what);
|
||||
|
||||
return oss.str().substr(0, oss.str().length() - spdlog::details::os::eol_size);
|
||||
}
|
||||
@@ -21,19 +21,6 @@ std::string log_info(const T& what, spdlog::level::level_enum logger_level = spd
|
||||
|
||||
|
||||
|
||||
//User defined class with operator<<
|
||||
struct some_logged_class
|
||||
{
|
||||
some_logged_class(const std::string val) :value(val) {};
|
||||
std::string value;
|
||||
};
|
||||
std::ostream& operator<<(std::ostream& os, const some_logged_class& c)
|
||||
{
|
||||
return os << c.value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST_CASE("basic_logging ", "[basic_logging]")
|
||||
{
|
||||
//const char
|
||||
@@ -49,7 +36,7 @@ TEST_CASE("basic_logging ", "[basic_logging]")
|
||||
REQUIRE(log_info(5.6) == "5.6");
|
||||
|
||||
//User defined class
|
||||
REQUIRE(log_info(some_logged_class("some_val")) == "some_val");
|
||||
//REQUIRE(log_info(some_logged_class("some_val")) == "some_val");
|
||||
}
|
||||
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
@@ -38,7 +38,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
Reference in New Issue
Block a user