Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
6b4fea39
Commit
6b4fea39
authored
Jan 10, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang-format
parent
a08ffcff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
21 deletions
+23
-21
formatter-bench.cpp
bench/formatter-bench.cpp
+8
-8
latency.cpp
bench/latency.cpp
+1
-1
common.h
include/spdlog/common.h
+0
-1
spdlog.h
include/spdlog/spdlog.h
+14
-11
No files found.
bench/formatter-bench.cpp
View file @
6b4fea39
...
...
@@ -48,12 +48,12 @@ void bench_formatters()
auto
pattern
=
std
::
string
(
"%"
)
+
flag
;
benchmark
::
RegisterBenchmark
(
pattern
.
c_str
(),
bench_formatter
,
pattern
);
// pattern = std::string("%16") + flag;
// benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
//
// // bench center padding
// pattern = std::string("%=16") + flag;
// benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
// pattern = std::string("%16") + flag;
// benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
//
// // bench center padding
// pattern = std::string("%=16") + flag;
// benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
}
// complex patterns
...
...
@@ -72,14 +72,14 @@ int main(int argc, char *argv[])
{
spdlog
::
set_pattern
(
"[%^%l%$] %v"
);
if
(
argc
!=
2
)
if
(
argc
!=
2
)
{
spdlog
::
error
(
"Usage: {} <pattern> (or
\"
all
\"
to bench all)"
,
argv
[
0
]);
exit
(
1
);
}
std
::
string
pattern
=
argv
[
1
];
if
(
pattern
==
"all"
)
if
(
pattern
==
"all"
)
{
bench_formatters
();
}
...
...
bench/latency.cpp
View file @
6b4fea39
...
...
@@ -73,7 +73,7 @@ void bench_disabled_macro(benchmark::State &state, std::shared_ptr<spdlog::logge
int
main
(
int
argc
,
char
*
argv
[])
{
using
spdlog
::
sinks
::
basic_file_sink_mt
;
using
spdlog
::
sinks
::
basic_file_sink_st
;
using
spdlog
::
sinks
::
null_sink_mt
;
...
...
include/spdlog/common.h
View file @
6b4fea39
...
...
@@ -51,7 +51,6 @@
#endif
#endif
// Get the basename of __FILE__ (at compile time if possible)
#if FMT_HAS_FEATURE(__builtin_strrchr)
#define SPDLOG_STRRCHR(str, sep) __builtin_strrchr(str, sep)
...
...
include/spdlog/spdlog.h
View file @
6b4fea39
...
...
@@ -298,8 +298,6 @@ inline void critical(const wchar_t *fmt, const Args &... args)
}
// namespace spdlog
//
// enable/disable log calls at compile time according to global level.
//
...
...
@@ -314,13 +312,13 @@ inline void critical(const wchar_t *fmt, const Args &... args)
//
#ifndef SPDLOG_FUNCTION
#define SPDLOG_FUNCTION __FUNCTION__
#define SPDLOG_FUNCTION __FUNCTION__
#endif
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
#define SPDLOG_LOGGER_TRACE(logger, ...)\
if
(logger->should_log(spdlog::level::trace))
\
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::trace, __VA_ARGS__)
#define SPDLOG_LOGGER_TRACE(logger, ...)
\
if
(logger->should_log(spdlog::level::trace))
\
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::trace, __VA_ARGS__)
#define SPDLOG_TRACE(...) SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)
#else
#define SPDLOG_LOGGER_TRACE(logger, ...) (void)0
...
...
@@ -328,7 +326,8 @@ inline void critical(const wchar_t *fmt, const Args &... args)
#endif
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_DEBUG
#define SPDLOG_LOGGER_DEBUG(logger, ...) logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::debug, __VA_ARGS__)
#define SPDLOG_LOGGER_DEBUG(logger, ...) \
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::debug, __VA_ARGS__)
#define SPDLOG_DEBUG(...) SPDLOG_LOGGER_DEBUG(spdlog::default_logger_raw(), __VA_ARGS__)
#else
#define SPDLOG_LOGGER_DEBUG(logger, ...) (void)0
...
...
@@ -336,7 +335,8 @@ inline void critical(const wchar_t *fmt, const Args &... args)
#endif
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_INFO
#define SPDLOG_LOGGER_INFO(logger, ...) logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::info, __VA_ARGS__)
#define SPDLOG_LOGGER_INFO(logger, ...) \
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::info, __VA_ARGS__)
#define SPDLOG_INFO(...) SPDLOG_LOGGER_INFO(spdlog::default_logger_raw(), __VA_ARGS__)
#else
#define SPDLOG_LOGGER_INFO(logger, ...) (void)0
...
...
@@ -344,7 +344,8 @@ inline void critical(const wchar_t *fmt, const Args &... args)
#endif
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_WARN
#define SPDLOG_LOGGER_WARN(logger, ...) logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::warn, __VA_ARGS__)
#define SPDLOG_LOGGER_WARN(logger, ...) \
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::warn, __VA_ARGS__)
#define SPDLOG_WARN(...) SPDLOG_LOGGER_WARN(spdlog::default_logger_raw(), __VA_ARGS__)
#else
#define SPDLOG_LOGGER_WARN(logger, ...) (void)0
...
...
@@ -352,7 +353,8 @@ inline void critical(const wchar_t *fmt, const Args &... args)
#endif
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_ERROR
#define SPDLOG_LOGGER_ERROR(logger, ...) logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::err, __VA_ARGS__)
#define SPDLOG_LOGGER_ERROR(logger, ...) \
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::err, __VA_ARGS__)
#define SPDLOG_ERROR(...) SPDLOG_LOGGER_ERROR(spdlog::default_logger_raw(), __VA_ARGS__)
#else
#define SPDLOG_LOGGER_ERROR(logger, ...) (void)0
...
...
@@ -360,7 +362,8 @@ inline void critical(const wchar_t *fmt, const Args &... args)
#endif
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_CRITICAL
#define SPDLOG_LOGGER_CRITICAL(logger, ...) logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::critical, __VA_ARGS__)
#define SPDLOG_LOGGER_CRITICAL(logger, ...) \
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, spdlog::level::critical, __VA_ARGS__)
#define SPDLOG_CRITICAL(...) SPDLOG_LOGGER_CRITICAL(spdlog::default_logger_raw(), __VA_ARGS__)
#else
#define SPDLOG_LOGGER_CRITICAL(logger, ...) (void)0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment