Fix IP address of udp sink example

This commit is contained in:
Chris Love 2021-08-26 06:36:31 -07:00
parent a15f5137ef
commit 649424b8ea

View File

@ -212,7 +212,7 @@ void stopwatch_example()
#include "spdlog/sinks/udp_sink.h"
void udp_example()
{
spdlog::sinks::udp_sink_config cfg("192.168.1.129", 11091);
spdlog::sinks::udp_sink_config cfg("127.0.0.1", 11091);
auto my_logger = spdlog::udp_logger_mt("udplog", cfg);
my_logger->set_level(spdlog::level::debug);
my_logger->info("hello world");
@ -231,15 +231,15 @@ void multi_sink_example()
spdlog::logger logger("multi_sink", {console_sink, file_sink});
logger.set_level(spdlog::level::debug);
logger.warn("this should appear in both console and file");
logger.info("this message should not appear in the console, only in the file");
}
logger.warn("this should
// User defined types logging by implementing operator<<
struct my_type
{
int i;
template<typename OStream>
template<typename OStream>appear in both console and file");
logger.info("this message should not appear in the console, only in the file");
}
friend OStream &operator<<(OStream &os, const my_type &c)
{
return os << "[my_type i=" << c.i << "]";