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
9a9e9aac
Commit
9a9e9aac
authored
May 15, 2016
by
gabime
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/gabime/spdlog
parents
80a432e6
58699a2b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
12 deletions
+12
-12
include/spdlog/details/async_log_helper.h
include/spdlog/details/async_log_helper.h
+4
-4
include/spdlog/details/async_logger_impl.h
include/spdlog/details/async_logger_impl.h
+1
-1
include/spdlog/details/pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+1
-1
include/spdlog/tweakme.h
include/spdlog/tweakme.h
+1
-1
tests/file_log.cpp
tests/file_log.cpp
+4
-4
tests/format.cpp
tests/format.cpp
+1
-1
No files found.
include/spdlog/details/async_log_helper.h
View file @
9a9e9aac
...
...
@@ -340,13 +340,13 @@ inline void spdlog::details::async_log_helper::sleep_or_yield(const spdlog::log_
using
namespace
std
::
this_thread
;
using
std
::
chrono
::
milliseconds
;
using
std
::
chrono
::
microseconds
;
auto
time_since_op
=
now
-
last_op_time
;
// spin upto 50 micros
if
(
time_since_op
<=
microseconds
(
50
))
return
;
// yield upto 150 micros
if
(
time_since_op
<=
microseconds
(
100
))
return
yield
();
...
...
@@ -356,7 +356,7 @@ inline void spdlog::details::async_log_helper::sleep_or_yield(const spdlog::log_
if
(
time_since_op
<=
milliseconds
(
200
))
return
sleep_for
(
milliseconds
(
20
));
// sleep for 200 ms
// sleep for 200 ms
return
sleep_for
(
milliseconds
(
200
));
}
...
...
include/spdlog/details/async_logger_impl.h
View file @
9a9e9aac
...
...
@@ -49,7 +49,7 @@ inline spdlog::async_logger::async_logger(const std::string& logger_name,
async_logger
(
logger_name
,
{
single_sink
},
queue_size
,
overflow_policy
,
worker_warmup_cb
,
flush_interval_ms
,
worker_teardown_cb
)
{}
},
queue_size
,
overflow_policy
,
worker_warmup_cb
,
flush_interval_ms
,
worker_teardown_cb
)
{}
inline
void
spdlog
::
async_logger
::
flush
()
...
...
include/spdlog/details/pattern_formatter_impl.h
View file @
9a9e9aac
...
...
@@ -619,7 +619,7 @@ inline void spdlog::pattern_formatter::format(details::log_msg& msg)
f
->
format
(
msg
,
tm_time
);
}
//write eol
msg
.
formatted
.
write
(
details
::
os
::
eol
,
details
::
os
::
eol_size
);
msg
.
formatted
.
write
(
details
::
os
::
eol
,
details
::
os
::
eol_size
);
}
catch
(
const
fmt
::
FormatError
&
e
)
{
...
...
include/spdlog/tweakme.h
View file @
9a9e9aac
...
...
@@ -65,6 +65,6 @@
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment to override default eol ("\n" or "\r\n" under Linux/Windows)
// Uncomment to override default eol ("\n" or "\r\n" under Linux/Windows)
// #define SPDLOG_EOL ";-)\n"
///////////////////////////////////////////////////////////////////////////////
tests/file_log.cpp
View file @
9a9e9aac
...
...
@@ -80,8 +80,8 @@ TEST_CASE("daily_logger", "[daily_logger]]")
TEST_CASE
(
"daily_logger with dateonly calculator"
,
"[daily_logger_dateonly]]"
)
{
using
sink_type
=
spdlog
::
sinks
::
daily_file_sink
<
std
::
mutex
,
spdlog
::
sinks
::
dateonly_daily_file_name_calculator
>
;
std
::
mutex
,
spdlog
::
sinks
::
dateonly_daily_file_name_calculator
>
;
prepare_logdir
();
//calculate filename (time based)
...
...
@@ -112,8 +112,8 @@ struct custom_daily_file_name_calculator
TEST_CASE
(
"daily_logger with custom calculator"
,
"[daily_logger_custom]]"
)
{
using
sink_type
=
spdlog
::
sinks
::
daily_file_sink
<
std
::
mutex
,
custom_daily_file_name_calculator
>
;
std
::
mutex
,
custom_daily_file_name_calculator
>
;
prepare_logdir
();
//calculate filename (time based)
...
...
tests/format.cpp
View file @
9a9e9aac
...
...
@@ -12,7 +12,7 @@ std::string log_info(const T& what, spdlog::level::level_enum logger_level = spd
oss_logger
.
set_level
(
logger_level
);
oss_logger
.
set_pattern
(
"%v"
);
oss_logger
.
info
()
<<
what
;
return
oss
.
str
().
substr
(
0
,
oss
.
str
().
length
()
-
spdlog
::
details
::
os
::
eol_size
);
}
...
...
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