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
f4bbe8b2
Commit
f4bbe8b2
authored
Aug 31, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some extra warnings from clang
parent
e52e258f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
13 deletions
+35
-13
example/Makefile-all-warn
example/Makefile-all-warn
+22
-0
include/spdlog/details/async_logger_impl.h
include/spdlog/details/async_logger_impl.h
+1
-1
include/spdlog/details/thread_pool.h
include/spdlog/details/thread_pool.h
+9
-9
include/spdlog/sinks/sink.h
include/spdlog/sinks/sink.h
+3
-1
tests/test_misc.cpp
tests/test_misc.cpp
+0
-2
No files found.
example/Makefile-all-warn
0 → 100644
View file @
f4bbe8b2
#-Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded
CXX ?= g++
CXX_FLAGS = -Wall -Wextra -pedantic -std=c++11 -pthread -I../include -fmax-errors=1 -Wconversion -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-weak-vtables -Wno-global-constructors
CXX_RELEASE_FLAGS = -O3 -march=native
CXX_DEBUG_FLAGS= -g
all: example
debug: example-debug
example: example.cpp
$(CXX) example.cpp -o example $(CXX_FLAGS) $(CXX_RELEASE_FLAGS) $(CXXFLAGS)
example-debug: example.cpp
$(CXX) example.cpp -o example-debug $(CXX_FLAGS) $(CXX_DEBUG_FLAGS) $(CXXFLAGS)
clean:
rm -f *.o logs/*.txt example example-debug
rebuild: clean all
rebuild-debug: clean debug
include/spdlog/details/async_logger_impl.h
View file @
f4bbe8b2
...
@@ -107,4 +107,4 @@ inline std::shared_ptr<spdlog::logger> spdlog::async_logger::clone(std::string n
...
@@ -107,4 +107,4 @@ inline std::shared_ptr<spdlog::logger> spdlog::async_logger::clone(std::string n
cloned
->
flush_on
(
this
->
flush_level
());
cloned
->
flush_on
(
this
->
flush_level
());
cloned
->
set_error_handler
(
this
->
error_handler
());
cloned
->
set_error_handler
(
this
->
error_handler
());
return
std
::
move
(
cloned
);
return
std
::
move
(
cloned
);
}
}
\ No newline at end of file
include/spdlog/details/thread_pool.h
View file @
f4bbe8b2
...
@@ -198,6 +198,13 @@ private:
...
@@ -198,6 +198,13 @@ private:
switch
(
incoming_async_msg
.
msg_type
)
switch
(
incoming_async_msg
.
msg_type
)
{
{
case
async_msg_type
:
:
log
:
{
log_msg
msg
;
incoming_async_msg
.
to_log_msg
(
msg
);
incoming_async_msg
.
worker_ptr
->
backend_log_
(
msg
);
return
true
;
}
case
async_msg_type
:
:
flush
:
case
async_msg_type
:
:
flush
:
{
{
incoming_async_msg
.
worker_ptr
->
backend_flush_
();
incoming_async_msg
.
worker_ptr
->
backend_flush_
();
...
@@ -208,16 +215,9 @@ private:
...
@@ -208,16 +215,9 @@ private:
{
{
return
false
;
return
false
;
}
}
default:
{
log_msg
msg
;
incoming_async_msg
.
to_log_msg
(
msg
);
incoming_async_msg
.
worker_ptr
->
backend_log_
(
msg
);
return
true
;
}
}
}
return
true
;
// should not be reached
assert
(
false
&&
"Unexpected async_msg_type"
);
return
true
;
}
}
};
};
...
...
include/spdlog/sinks/sink.h
View file @
f4bbe8b2
...
@@ -22,7 +22,9 @@ public:
...
@@ -22,7 +22,9 @@ public:
explicit
sink
(
std
::
unique_ptr
<
spdlog
::
pattern_formatter
>
formatter
)
explicit
sink
(
std
::
unique_ptr
<
spdlog
::
pattern_formatter
>
formatter
)
:
level_
(
level
::
trace
)
:
level_
(
level
::
trace
)
,
formatter_
(
std
::
move
(
formatter
)){};
,
formatter_
(
std
::
move
(
formatter
))
{
}
virtual
~
sink
()
=
default
;
virtual
~
sink
()
=
default
;
virtual
void
log
(
const
details
::
log_msg
&
msg
)
=
0
;
virtual
void
log
(
const
details
::
log_msg
&
msg
)
=
0
;
...
...
tests/test_misc.cpp
View file @
f4bbe8b2
...
@@ -92,7 +92,6 @@ TEST_CASE("periodic flush", "[periodic_flush]")
...
@@ -92,7 +92,6 @@ TEST_CASE("periodic flush", "[periodic_flush]")
spdlog
::
drop_all
();
spdlog
::
drop_all
();
}
}
TEST_CASE
(
"clone"
,
"[clone]"
)
TEST_CASE
(
"clone"
,
"[clone]"
)
{
{
using
namespace
spdlog
;
using
namespace
spdlog
;
...
@@ -133,6 +132,5 @@ TEST_CASE("clone async", "[clone]")
...
@@ -133,6 +132,5 @@ TEST_CASE("clone async", "[clone]")
auto
test_sink
=
std
::
static_pointer_cast
<
sinks
::
test_sink_mt
>
(
cloned
->
sinks
()[
0
]);
auto
test_sink
=
std
::
static_pointer_cast
<
sinks
::
test_sink_mt
>
(
cloned
->
sinks
()[
0
]);
REQUIRE
(
test_sink
->
msg_counter
()
==
2
);
REQUIRE
(
test_sink
->
msg_counter
()
==
2
);
spdlog
::
drop_all
();
spdlog
::
drop_all
();
}
}
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