mirror of
https://github.com/gabime/spdlog.git
synced 2025-02-05 04:06:46 +08:00
use data() istead of c_str() in ansicolor_sink
This commit is contained in:
parent
6cc7e7382e
commit
7bbab6889d
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// Copyright(c) 2016 Kevin M. Godby (a modified version by spdlog).
|
// Copyright(c) 2017 spdlog authors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
//
|
//
|
||||||
|
|
||||||
@ -56,9 +56,9 @@ protected:
|
|||||||
{
|
{
|
||||||
const std::string& prefix = colors_[msg.level];
|
const std::string& prefix = colors_[msg.level];
|
||||||
const std::string& reset = colors_[level::off];
|
const std::string& reset = colors_[level::off];
|
||||||
fwrite(prefix.c_str(), sizeof(char), prefix.size(), target_file_);
|
fwrite(prefix.data(), sizeof(char), prefix.size(), target_file_);
|
||||||
fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), target_file_);
|
fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), target_file_);
|
||||||
fwrite(reset.c_str(), sizeof(char), reset.size(), target_file_);
|
fwrite(reset.data(), sizeof(char), reset.size(), target_file_);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user