Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabime <gmelman1@gmail.com>2018-04-09 14:14:52 +0300
committergabime <gmelman1@gmail.com>2018-04-09 14:14:52 +0300
commitcfb450c059ceaccaf6289ac6d2ce98db84ef69a3 (patch)
treefe6d00d8138a4b5116dad78ea201e49a0bd984b4
parentb416685d6f601a12a9fd6428aa605a6f12330ef2 (diff)
Fixed eol write in pattern_formatter_impl
-rw-r--r--example/example.cpp10
-rw-r--r--include/spdlog/details/pattern_formatter_impl.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/example/example.cpp b/example/example.cpp
index 0597ec75..a55a7db6 100644
--- a/example/example.cpp
+++ b/example/example.cpp
@@ -26,8 +26,17 @@ int main(int, char *[])
{
try
{
+ spdlog::set_async_mode(1024);
// Console logger with color
auto console = spd::stdout_color_mt("console");
+
+ for (int i = 0; i < 2000; i++)
+ {
+ console->info("{} Hello thread pool!", i);
+ }
+
+ return 0;
+
console->info("Welcome to spdlog!");
console->error("Some error message with arg{}..", 1);
@@ -39,6 +48,7 @@ int main(int, char *[])
console->info("{:<30}", "left aligned");
spd::get("console")->info("loggers can be retrieved from a global registry using the spdlog::get(logger_name) function");
+ return 0;
// Create basic file logger (not rotated)
auto my_logger = spd::basic_logger_mt("basic_logger", "logs/basic-log.txt");
diff --git a/include/spdlog/details/pattern_formatter_impl.h b/include/spdlog/details/pattern_formatter_impl.h
index f1de628b..b801221b 100644
--- a/include/spdlog/details/pattern_formatter_impl.h
+++ b/include/spdlog/details/pattern_formatter_impl.h
@@ -704,5 +704,5 @@ inline void spdlog::pattern_formatter::format(details::log_msg &msg)
f->format(msg, tm_time);
}
// write eol
- msg.formatted.write(_eol.data(), _eol.size());
+ msg.formatted << _eol;
}