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
ad624432
Commit
ad624432
authored
Feb 25, 2018
by
Daniel Chabrowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
google-explicit-constructor
parent
1e1ca231
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
18 deletions
+18
-18
common.h
include/spdlog/common.h
+3
-3
async_log_helper.h
include/spdlog/details/async_log_helper.h
+2
-2
mpmc_bounded_q.h
include/spdlog/details/mpmc_bounded_q.h
+5
-6
null_mutex.h
include/spdlog/details/null_mutex.h
+1
-1
registry.h
include/spdlog/details/registry.h
+5
-4
logger.h
include/spdlog/logger.h
+1
-1
ansicolor_sink.h
include/spdlog/sinks/ansicolor_sink.h
+1
-1
No files found.
include/spdlog/common.h
View file @
ad624432
...
...
@@ -106,7 +106,6 @@ using level_hasher = std::hash<int>;
}
//level
//
// Async overflow policy - block by default.
//
...
...
@@ -139,12 +138,14 @@ std::string errno_str(int err_num);
class
spdlog_ex
:
public
std
::
exception
{
public
:
spdlog_ex
(
const
std
::
string
&
msg
)
:
_msg
(
msg
)
explicit
spdlog_ex
(
std
::
string
msg
)
:
_msg
(
std
::
move
(
msg
)
)
{}
spdlog_ex
(
const
std
::
string
&
msg
,
int
last_errno
)
{
_msg
=
msg
+
": "
+
details
::
os
::
errno_str
(
last_errno
);
}
const
char
*
what
()
const
SPDLOG_NOEXCEPT
override
{
return
_msg
.
c_str
();
...
...
@@ -163,5 +164,4 @@ using filename_t = std::wstring;
using
filename_t
=
std
::
string
;
#endif
}
//spdlog
include/spdlog/details/async_log_helper.h
View file @
ad624432
...
...
@@ -67,7 +67,7 @@ async_msg(async_msg&& other) SPDLOG_NOEXCEPT:
msg_id
(
other
.
msg_id
)
{}
async_msg
(
async_msg_type
m_type
)
:
explicit
async_msg
(
async_msg_type
m_type
)
:
level
(
level
::
info
),
thread_id
(
0
),
msg_type
(
m_type
),
...
...
@@ -91,7 +91,7 @@ async_msg(async_msg&& other) SPDLOG_NOEXCEPT:
async_msg
&
operator
=
(
const
async_msg
&
other
)
=
delete
;
// construct from log_msg
async_msg
(
const
details
::
log_msg
&
m
)
:
explicit
async_msg
(
const
details
::
log_msg
&
m
)
:
level
(
m
.
level
),
time
(
m
.
time
),
thread_id
(
m
.
thread_id
),
...
...
include/spdlog/details/mpmc_bounded_q.h
View file @
ad624432
...
...
@@ -53,13 +53,13 @@ namespace spdlog
namespace
details
{
template
<
typename
T
>
template
<
typename
T
>
class
mpmc_bounded_queue
{
public
:
using
item_type
=
T
;
mpmc_bounded_queue
(
size_t
buffer_size
)
explicit
mpmc_bounded_queue
(
size_t
buffer_size
)
:
max_size_
(
buffer_size
),
buffer_
(
new
cell_t
[
buffer_size
]),
buffer_mask_
(
buffer_size
-
1
)
...
...
@@ -79,6 +79,8 @@ public:
delete
[]
buffer_
;
}
mpmc_bounded_queue
(
mpmc_bounded_queue
const
&
)
=
delete
;
void
operator
=
(
mpmc_bounded_queue
const
&
)
=
delete
;
bool
enqueue
(
T
&&
data
)
{
...
...
@@ -167,9 +169,6 @@ private:
cacheline_pad_t
pad2_
;
std
::
atomic
<
size_t
>
dequeue_pos_
;
cacheline_pad_t
pad3_
;
mpmc_bounded_queue
(
mpmc_bounded_queue
const
&
)
=
delete
;
void
operator
=
(
mpmc_bounded_queue
const
&
)
=
delete
;
};
}
// ns details
...
...
include/spdlog/details/null_mutex.h
View file @
ad624432
...
...
@@ -27,7 +27,7 @@ struct null_atomic_int
int
value
;
null_atomic_int
()
=
default
;
null_atomic_int
(
int
val
)
:
value
(
val
)
explicit
null_atomic_int
(
int
val
)
:
value
(
val
)
{}
int
load
(
std
::
memory_order
)
const
...
...
include/spdlog/details/registry.h
View file @
ad624432
...
...
@@ -26,9 +26,12 @@ namespace spdlog
{
namespace
details
{
template
<
class
Mutex
>
class
registry_t
template
<
class
Mutex
>
class
registry_t
{
public
:
registry_t
<
Mutex
>
(
const
registry_t
<
Mutex
>&
)
=
delete
;
registry_t
<
Mutex
>&
operator
=
(
const
registry_t
<
Mutex
>&
)
=
delete
;
void
register_logger
(
std
::
shared_ptr
<
logger
>
logger
)
{
...
...
@@ -38,7 +41,6 @@ public:
_loggers
[
logger_name
]
=
logger
;
}
std
::
shared_ptr
<
logger
>
get
(
const
std
::
string
&
logger_name
)
{
std
::
lock_guard
<
Mutex
>
lock
(
_mutex
);
...
...
@@ -111,6 +113,7 @@ public:
std
::
lock_guard
<
Mutex
>
lock
(
_mutex
);
_loggers
.
clear
();
}
std
::
shared_ptr
<
logger
>
create
(
const
std
::
string
&
logger_name
,
sinks_init_list
sinks
)
{
return
create
(
logger_name
,
sinks
.
begin
(),
sinks
.
end
());
...
...
@@ -195,8 +198,6 @@ public:
private
:
registry_t
<
Mutex
>
()
=
default
;
registry_t
<
Mutex
>
(
const
registry_t
<
Mutex
>&
)
=
delete
;
registry_t
<
Mutex
>&
operator
=
(
const
registry_t
<
Mutex
>&
)
=
delete
;
void
throw_if_exists
(
const
std
::
string
&
logger_name
)
{
...
...
include/spdlog/logger.h
View file @
ad624432
...
...
@@ -25,7 +25,7 @@ namespace spdlog
class
logger
{
public
:
logger
(
const
std
::
string
&
logger_
name
,
sink_ptr
single_sink
);
logger
(
const
std
::
string
&
name
,
sink_ptr
single_sink
);
logger
(
const
std
::
string
&
name
,
sinks_init_list
);
template
<
class
It
>
logger
(
const
std
::
string
&
name
,
const
It
&
begin
,
const
It
&
end
);
...
...
include/spdlog/sinks/ansicolor_sink.h
View file @
ad624432
...
...
@@ -26,7 +26,7 @@ template <class Mutex>
class
ansicolor_sink
:
public
base_sink
<
Mutex
>
{
public
:
ansicolor_sink
(
FILE
*
file
)
:
target_file_
(
file
)
explicit
ansicolor_sink
(
FILE
*
file
)
:
target_file_
(
file
)
{
should_do_colors_
=
details
::
os
::
in_terminal
(
file
)
&&
details
::
os
::
is_color_terminal
();
colors_
[
level
::
trace
]
=
cyan
;
...
...
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