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
db5af8ea
Commit
db5af8ea
authored
Jun 13, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang-format
parent
c09dee77
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
async_bench.cpp
bench/async_bench.cpp
+6
-6
pattern_formatter-inl.h
include/spdlog/details/pattern_formatter-inl.h
+2
-2
spdlog.h
include/spdlog/spdlog.h
+1
-1
test_pattern_formatter.cpp
tests/test_pattern_formatter.cpp
+0
-1
No files found.
bench/async_bench.cpp
View file @
db5af8ea
...
...
@@ -26,11 +26,10 @@ using namespace utils;
void
bench_mt
(
int
howmany
,
std
::
shared_ptr
<
spdlog
::
logger
>
log
,
int
thread_count
);
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996) //disable fopen warning under msvc
#endif // _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996) //
disable fopen warning under msvc
#endif
// _MSC_VER
int
count_lines
(
const
char
*
filename
)
{
...
...
@@ -59,7 +58,7 @@ void verify_file(const char *filename, int expected_count)
}
#ifdef _MSC_VER
#pragma warning(pop)
#pragma warning(pop)
#endif
int
main
(
int
argc
,
char
*
argv
[])
...
...
@@ -130,7 +129,8 @@ int main(int argc, char *argv[])
{
auto
tp
=
std
::
make_shared
<
details
::
thread_pool
>
(
queue_size
,
1
);
auto
file_sink
=
std
::
make_shared
<
spdlog
::
sinks
::
basic_file_sink_mt
>
(
filename
,
true
);
auto
logger
=
std
::
make_shared
<
async_logger
>
(
"async_logger"
,
std
::
move
(
file_sink
),
std
::
move
(
tp
),
async_overflow_policy
::
overrun_oldest
);
auto
logger
=
std
::
make_shared
<
async_logger
>
(
"async_logger"
,
std
::
move
(
file_sink
),
std
::
move
(
tp
),
async_overflow_policy
::
overrun_oldest
);
bench_mt
(
howmany
,
std
::
move
(
logger
),
threads
);
}
spdlog
::
shutdown
();
...
...
include/spdlog/details/pattern_formatter-inl.h
View file @
db5af8ea
...
...
@@ -828,10 +828,10 @@ public:
:
flag_formatter
(
padinfo
)
{}
static
const
char
*
basename
(
const
char
*
filename
)
static
const
char
*
basename
(
const
char
*
filename
)
{
const
char
*
rv
=
std
::
strrchr
(
filename
,
os
::
folder_sep
);
return
rv
!=
nullptr
?
rv
+
1
:
filename
;
return
rv
!=
nullptr
?
rv
+
1
:
filename
;
}
void
format
(
const
details
::
log_msg
&
msg
,
const
std
::
tm
&
,
fmt
::
memory_buffer
&
dest
)
override
...
...
include/spdlog/spdlog.h
View file @
db5af8ea
...
...
@@ -267,7 +267,7 @@ inline void critical(const wchar_t *fmt, const Args &... args)
do \
{ \
if (logger->should_log(level)) \
logger->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \
logger->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__);
\
} while (0)
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
...
...
tests/test_pattern_formatter.cpp
View file @
db5af8ea
...
...
@@ -301,4 +301,3 @@ TEST_CASE("full filename formatter", "[pattern_formatter]")
formatter
.
format
(
msg
,
formatted
);
REQUIRE
(
fmt
::
to_string
(
formatted
)
==
"/a/b/c/d/myfile.cpp:123"
);
}
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