mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-31 01:29:21 +08:00
Fixed warnings
This commit is contained in:
parent
28ea21b241
commit
9f4492da61
@ -121,6 +121,7 @@ struct fmt::formatter<spdlog::details::dump_info<T>, char> {
|
|||||||
show_ascii = true;
|
show_ascii = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
|
|
||||||
++it;
|
++it;
|
||||||
|
@ -47,7 +47,7 @@ template <typename Mutex, typename FileNameCalc = hourly_filename_calculator>
|
|||||||
class hourly_file_sink final : public base_sink<Mutex> {
|
class hourly_file_sink final : public base_sink<Mutex> {
|
||||||
public:
|
public:
|
||||||
// create hourly file sink which rotates on given time
|
// create hourly file sink which rotates on given time
|
||||||
hourly_file_sink(filename_t base_filename,
|
explicit hourly_file_sink(filename_t base_filename,
|
||||||
bool truncate = false,
|
bool truncate = false,
|
||||||
uint16_t max_files = 0,
|
uint16_t max_files = 0,
|
||||||
const file_event_handlers &event_handlers = {})
|
const file_event_handlers &event_handlers = {})
|
||||||
|
@ -21,7 +21,7 @@ template <typename Mutex>
|
|||||||
class msvc_sink final : public base_sink<Mutex> {
|
class msvc_sink final : public base_sink<Mutex> {
|
||||||
public:
|
public:
|
||||||
msvc_sink() = default;
|
msvc_sink() = default;
|
||||||
msvc_sink(bool check_debugger_present)
|
explicit msvc_sink(bool check_debugger_present)
|
||||||
: check_debugger_present_{check_debugger_present} {}
|
: check_debugger_present_{check_debugger_present} {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -29,9 +29,11 @@ void file_helper::open(const filename_t &fname, bool truncate) {
|
|||||||
if (event_handlers_.before_open) {
|
if (event_handlers_.before_open) {
|
||||||
event_handlers_.before_open(filename_);
|
event_handlers_.before_open(filename_);
|
||||||
}
|
}
|
||||||
for (int tries = 0; tries < open_tries_; ++tries) {
|
|
||||||
// create containing folder if not exists already.
|
// create containing folder if not exists already.
|
||||||
os::create_dir(os::dir_name(fname));
|
os::create_dir(os::dir_name(fname));
|
||||||
|
|
||||||
|
for (int tries = 0; tries < open_tries_; ++tries) {
|
||||||
if (truncate) {
|
if (truncate) {
|
||||||
// Truncate by opening-and-closing a tmp file in "wb" mode, always
|
// Truncate by opening-and-closing a tmp file in "wb" mode, always
|
||||||
// opening the actual log-we-write-to in "ab" mode, since that
|
// opening the actual log-we-write-to in "ab" mode, since that
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
using spdlog::details::file_helper;
|
using spdlog::details::file_helper;
|
||||||
|
|
||||||
static void write_with_helper(file_helper &helper, size_t howmany) {
|
static void write_with_helper(const file_helper &helper, size_t howmany) {
|
||||||
spdlog::memory_buf_t formatted;
|
spdlog::memory_buf_t formatted;
|
||||||
spdlog::fmt_lib::format_to(std::back_inserter(formatted), "{}", std::string(howmany, '1'));
|
spdlog::fmt_lib::format_to(std::back_inserter(formatted), "{}", std::string(howmany, '1'));
|
||||||
helper.write(formatted);
|
helper.write(formatted);
|
||||||
|
Loading…
Reference in New Issue
Block a user