Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
6db8beea
Commit
6db8beea
authored
Nov 10, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed un needed file
parent
4f663134
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
58 deletions
+0
-58
include/spdlog/sinks/ringbuffer_sink-inl.h
include/spdlog/sinks/ringbuffer_sink-inl.h
+0
-58
No files found.
include/spdlog/sinks/ringbuffer_sink-inl.h
deleted
100644 → 0
View file @
4f663134
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
//#ifndef SPDLOG_HEADER_ONLY
//#include "spdlog/sinks/ringbuffer_sink.h"
//#endif
#include "spdlog/common.h"
namespace
spdlog
{
namespace
sinks
{
template
<
typename
Mutex
>
SPDLOG_INLINE
ringbuffer_sink
<
Mutex
>::
ringbuffer_sink
(
size_t
n_items
)
{
buf_
=
details
::
circular_q
<
details
::
log_msg_buffer
>
(
n_items
);
}
template
<
typename
Mutex
>
SPDLOG_INLINE
void
ringbuffer_sink
<
Mutex
>::
sink_it_
(
const
details
::
log_msg
&
msg
)
{
buf_
.
push_back
(
details
::
log_msg_buffer
{
msg
});
}
template
<
typename
Mutex
>
SPDLOG_INLINE
std
::
vector
<
std
::
string
>
ringbuffer_sink
<
Mutex
>::
formatted_messages
(
size_t
lim
)
{
std
::
lock_guard
<
Mutex
>
lock
(
base_sink
<
Mutex
>::
mutex_
);
auto
n_items
=
lim
>
0
?
(
std
::
min
)(
lim
,
buf_
.
size
())
:
buf_
.
size
();
std
::
vector
<
std
::
string
>
ret
;
ret
.
reserve
(
n_items
);
for
(
size_t
i
=
0
;
i
<
n_items
;
i
++
)
{
memory_buf_t
formatted
;
base_sink
<
Mutex
>::
formatter_
->
format
(
buf_
.
at
(
i
),
formatted
);
ret
.
push_back
(
fmt
::
to_string
(
formatted
));
}
return
ret
;
}
template
<
typename
Mutex
>
SPDLOG_INLINE
std
::
vector
<
details
::
log_msg_buffer
>
ringbuffer_sink
<
Mutex
>::
raw_messages
(
size_t
lim
)
{
std
::
lock_guard
<
Mutex
>
lock
(
base_sink
<
Mutex
>::
mutex_
);
auto
n_items
=
lim
>
0
?
(
std
::
min
)(
lim
,
buf_
.
size
())
:
buf_
.
size
();
std
::
vector
<
details
::
log_msg_buffer
>
ret
;
ret
.
reserve
(
n_items
);
for
(
size_t
i
=
0
;
i
<
n_items
;
i
++
)
{
ret
.
push_back
(
buf_
.
at
(
i
));
}
return
ret
;
}
}
// 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