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
a7ba6e44
Commit
a7ba6e44
authored
Jul 18, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang-format
parent
baa978ab
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
include/spdlog/logger-inl.h
include/spdlog/logger-inl.h
+1
-2
include/spdlog/logger.h
include/spdlog/logger.h
+9
-3
include/spdlog/sinks/stdout_sinks.h
include/spdlog/sinks/stdout_sinks.h
+0
-2
include/spdlog/sinks/wincolor_sink-inl.h
include/spdlog/sinks/wincolor_sink-inl.h
+5
-5
src/spdlog.cpp
src/spdlog.cpp
+0
-3
No files found.
include/spdlog/logger-inl.h
View file @
a7ba6e44
...
...
@@ -205,7 +205,6 @@ SPDLOG_INLINE bool logger::should_flush_(const details::log_msg &msg)
return
(
msg
.
level
>=
flush_level
)
&&
(
msg
.
level
!=
level
::
off
);
}
SPDLOG_INLINE
void
logger
::
err_handler_
(
const
std
::
string
&
msg
)
{
...
...
@@ -222,7 +221,7 @@ SPDLOG_INLINE void logger::err_handler_(const std::string &msg)
std
::
lock_guard
<
std
::
mutex
>
lk
{
mutex
};
auto
now
=
system_clock
::
now
();
err_counter
++
;
if
(
now
-
last_report_time
<
std
::
chrono
::
seconds
(
1
))
if
(
now
-
last_report_time
<
std
::
chrono
::
seconds
(
1
))
{
return
;
}
...
...
include/spdlog/logger.h
View file @
a7ba6e44
...
...
@@ -24,9 +24,15 @@
#include <vector>
#define SPDLOG_LOGGER_CATCH() \
catch (const std::exception &ex) { err_handler_(ex.what());} \
catch (...) {err_handler_("Unknown exception in logger");}
#define SPDLOG_LOGGER_CATCH() \
catch (const std::exception &ex) \
{ \
err_handler_(ex.what()); \
} \
catch (...) \
{ \
err_handler_("Unknown exception in logger"); \
}
namespace
spdlog
{
class
logger
...
...
include/spdlog/sinks/stdout_sinks.h
View file @
a7ba6e44
...
...
@@ -71,8 +71,6 @@ std::shared_ptr<logger> stderr_logger_st(const std::string &logger_name);
}
// namespace spdlog
#ifdef SPDLOG_HEADER_ONLY
#include "stdout_sinks-inl.h"
#endif
include/spdlog/sinks/wincolor_sink-inl.h
View file @
a7ba6e44
...
...
@@ -68,8 +68,8 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg)
// in color range
auto
orig_attribs
=
set_foreground_color_
(
colors_
[
msg
.
level
]);
print_range_
(
formatted
,
msg
.
color_range_start
,
msg
.
color_range_end
);
// reset to orig colors
::
SetConsoleTextAttribute
(
out_handle_
,
orig_attribs
);
// reset to orig colors
::
SetConsoleTextAttribute
(
out_handle_
,
orig_attribs
);
print_range_
(
formatted
,
msg
.
color_range_end
,
formatted
.
size
());
}
else
// print without colors if color range is invalid (or color is disabled)
...
...
@@ -149,12 +149,12 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::write_to_file_(const fmt::memory
DWORD
total_written
=
0
;
do
{
DWORD
bytes_written
=
0
;
bool
ok
=
::
WriteFile
(
out_handle_
,
formatted
.
data
()
+
total_written
,
size
-
total_written
,
&
bytes_written
,
nullptr
)
!=
0
;
DWORD
bytes_written
=
0
;
bool
ok
=
::
WriteFile
(
out_handle_
,
formatted
.
data
()
+
total_written
,
size
-
total_written
,
&
bytes_written
,
nullptr
)
!=
0
;
if
(
!
ok
||
bytes_written
==
0
)
{
throw
spdlog_ex
(
"wincolor_sink: write_to_file_ failed. GetLastError(): "
+
std
::
to_string
(
::
GetLastError
()));
}
}
total_written
+=
bytes_written
;
}
while
(
total_written
<
size
);
}
...
...
src/spdlog.cpp
View file @
a7ba6e44
...
...
@@ -80,8 +80,6 @@ template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::async_f
template
std
::
shared_ptr
<
spdlog
::
logger
>
spdlog
::
stderr_color_mt
<
spdlog
::
async_factory
>
(
const
std
::
string
&
logger_name
,
color_mode
mode
);
template
std
::
shared_ptr
<
spdlog
::
logger
>
spdlog
::
stderr_color_st
<
spdlog
::
async_factory
>
(
const
std
::
string
&
logger_name
,
color_mode
mode
);
#include "spdlog/sinks/stdout_sinks-inl.h"
template
class
spdlog
::
sinks
::
stdout_sink_base
<
spdlog
::
details
::
console_mutex
>;
...
...
@@ -101,7 +99,6 @@ template std::shared_ptr<spdlog::logger> spdlog::stdout_logger_st<spdlog::async_
template
std
::
shared_ptr
<
spdlog
::
logger
>
spdlog
::
stderr_logger_mt
<
spdlog
::
async_factory
>
(
const
std
::
string
&
logger_name
);
template
std
::
shared_ptr
<
spdlog
::
logger
>
spdlog
::
stderr_logger_st
<
spdlog
::
async_factory
>
(
const
std
::
string
&
logger_name
);
// Slightly modified version of fmt lib's format.cc source file.
// Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved.
...
...
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