Fix IP address of udp sink example
This commit is contained in:
parent
a15f5137ef
commit
649424b8ea
@ -212,7 +212,7 @@ void stopwatch_example()
|
|||||||
#include "spdlog/sinks/udp_sink.h"
|
#include "spdlog/sinks/udp_sink.h"
|
||||||
void udp_example()
|
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);
|
auto my_logger = spdlog::udp_logger_mt("udplog", cfg);
|
||||||
my_logger->set_level(spdlog::level::debug);
|
my_logger->set_level(spdlog::level::debug);
|
||||||
my_logger->info("hello world");
|
my_logger->info("hello world");
|
||||||
@ -231,15 +231,15 @@ void multi_sink_example()
|
|||||||
|
|
||||||
spdlog::logger logger("multi_sink", {console_sink, file_sink});
|
spdlog::logger logger("multi_sink", {console_sink, file_sink});
|
||||||
logger.set_level(spdlog::level::debug);
|
logger.set_level(spdlog::level::debug);
|
||||||
logger.warn("this should appear in both console and file");
|
logger.warn("this should
|
||||||
logger.info("this message should not appear in the console, only in the file");
|
|
||||||
}
|
|
||||||
|
|
||||||
// User defined types logging by implementing operator<<
|
// User defined types logging by implementing operator<<
|
||||||
struct my_type
|
struct my_type
|
||||||
{
|
{
|
||||||
int i;
|
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)
|
friend OStream &operator<<(OStream &os, const my_type &c)
|
||||||
{
|
{
|
||||||
return os << "[my_type i=" << c.i << "]";
|
return os << "[my_type i=" << c.i << "]";
|
||||||
|
Loading…
Reference in New Issue
Block a user