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
58699a2b
Commit
58699a2b
authored
May 14, 2016
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astyle
parent
10d5292b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
12 deletions
+12
-12
async_log_helper.h
include/spdlog/details/async_log_helper.h
+4
-4
async_logger_impl.h
include/spdlog/details/async_logger_impl.h
+1
-1
pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+1
-1
tweakme.h
include/spdlog/tweakme.h
+1
-1
file_log.cpp
tests/file_log.cpp
+4
-4
format.cpp
tests/format.cpp
+1
-1
No files found.
include/spdlog/details/async_log_helper.h
View file @
58699a2b
...
...
@@ -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 @
58699a2b
...
...
@@ -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 @
58699a2b
...
...
@@ -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 @
58699a2b
...
...
@@ -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 @
58699a2b
...
...
@@ -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 @
58699a2b
...
...
@@ -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