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
ee2fd265
Commit
ee2fd265
authored
May 20, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added async tests
parent
5b84f30b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
test_sink.h
tests/test_sink.h
+48
-0
No files found.
tests/test_sink.h
0 → 100644
View file @
ee2fd265
//
// Copyright(c) 2018 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#pragma once
#include "spdlog/details/null_mutex.h"
#include "spdlog/sinks/base_sink.h"
#include <mutex>
namespace
spdlog
{
namespace
sinks
{
template
<
class
Mutex
>
class
test_sink
:
public
base_sink
<
Mutex
>
{
public
:
size_t
msg_counter
()
{
return
msg_counter_
;
}
size_t
flushed_msg_counter
()
{
return
flushed_msg_counter_
;
}
protected
:
void
_sink_it
(
const
details
::
log_msg
&
)
override
{
msg_counter_
++
;
}
void
_flush
()
override
{
flushed_msg_counter_
+=
msg_counter_
;
}
size_t
msg_counter_
{
0
};
size_t
flushed_msg_counter_
{
0
};
};
using
test_sink_mt
=
test_sink
<
std
::
mutex
>
;
using
test_sink_st
=
test_sink
<
details
::
null_mutex
>
;
}
// namespace sinks
}
// namespace spdlog
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