Commit 5f276971 authored by gabime's avatar gabime

clang-format

parent 261d2c5a
......@@ -39,7 +39,6 @@ int main(int argc, char *argv[])
size_t file_size = 30 * 1024 * 1024;
size_t rotating_files = 5;
try
{
......
......@@ -23,6 +23,7 @@ void clone_example();
int main(int, char *[])
{
syslog_example();
spdlog::info("Welcome to spdlog version {}.{}.{} !", SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH);
spdlog::warn("Easy padding in numbers like {:08d}", 12);
spdlog::critical("Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}", 42);
......
......@@ -892,13 +892,12 @@ public:
template<typename Units>
class elapsed_formatter final : public flag_formatter
{
public:
using DurationUnits = Units;
explicit elapsed_formatter(padding_info padinfo)
: flag_formatter(padinfo),
last_message_time_(log_clock::now())
: flag_formatter(padinfo)
, last_message_time_(log_clock::now())
{}
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
......@@ -919,7 +918,6 @@ public:
protected:
log_clock::time_point last_message_time_;
};
// Full info formatter
......
......@@ -33,7 +33,6 @@
// [2019-06-25 17:50:56.512] [logger] [info] Skipped 3 duplicate messages..
// [2019-06-25 17:50:56.512] [logger] [info] Different Hello
#ifdef SPDLOG_NO_DATETIME
#error "spdlog::sinks::dup_filter_sink: cannot work when SPDLOG_NO_DATETIME is defined"
#endif
......
......@@ -61,7 +61,7 @@ protected:
size_t length = payload.size();
// limit to max int
if(length > std::numeric_limits<int>::max())
if (length > std::numeric_limits<int>::max())
{
length = std::numeric_limits<int>::max();
}
......
......@@ -46,7 +46,7 @@ protected:
size_t length = msg.payload.size();
// limit to max int
if(length > std::numeric_limits<int>::max())
if (length > std::numeric_limits<int>::max())
{
length = std::numeric_limits<int>::max();
}
......@@ -60,9 +60,8 @@ protected:
}
else
{
err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), msg.payload.data(), "PRIORITY=%d",
syslog_level(msg.level), "SOURCE_FILE=%s", msg.source.filename, "SOURCE_LINE=%d", msg.source.line, "SOURCE_FUNC=%s",
msg.source.funcname, nullptr);
err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), msg.payload.data(), "PRIORITY=%d", syslog_level(msg.level),
"SOURCE_FILE=%s", msg.source.filename, "SOURCE_LINE=%d", msg.source.line, "SOURCE_FUNC=%s", msg.source.funcname, nullptr);
}
if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment