mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-24 09:31:34 +08:00
clang-format
This commit is contained in:
parent
261d2c5ae4
commit
5f27697198
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user