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
d5a3bb52
Commit
d5a3bb52
authored
Feb 25, 2018
by
Daniel Chabrowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readability-else-after-return
parent
9ebb9ff3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
17 deletions
+11
-17
include/spdlog/details/async_log_helper.h
include/spdlog/details/async_log_helper.h
+4
-7
include/spdlog/details/os.h
include/spdlog/details/os.h
+1
-4
include/spdlog/details/pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+3
-3
include/spdlog/sinks/file_sinks.h
include/spdlog/sinks/file_sinks.h
+3
-3
No files found.
include/spdlog/details/async_log_helper.h
View file @
d5a3bb52
...
@@ -328,13 +328,10 @@ inline bool spdlog::details::async_log_helper::process_next_msg(log_clock::time_
...
@@ -328,13 +328,10 @@ inline bool spdlog::details::async_log_helper::process_next_msg(log_clock::time_
// Handle empty queue..
// Handle empty queue..
// This is the only place where the queue can terminate or flush to avoid losing messages already in the queue
// This is the only place where the queue can terminate or flush to avoid losing messages already in the queue
else
auto
now
=
details
::
os
::
now
();
{
handle_flush_interval
(
now
,
last_flush
);
auto
now
=
details
::
os
::
now
();
sleep_or_yield
(
now
,
last_pop
);
handle_flush_interval
(
now
,
last_flush
);
return
!
_terminate_requested
;
sleep_or_yield
(
now
,
last_pop
);
return
!
_terminate_requested
;
}
}
}
// flush all sinks if _flush_interval_ms has expired
// flush all sinks if _flush_interval_ms has expired
...
...
include/spdlog/details/os.h
View file @
d5a3bb52
...
@@ -403,10 +403,7 @@ inline std::string errno_to_string(char buf[256], int res)
...
@@ -403,10 +403,7 @@ inline std::string errno_to_string(char buf[256], int res)
{
{
return
std
::
string
(
buf
);
return
std
::
string
(
buf
);
}
}
else
return
"Unknown error"
;
{
return
"Unknown error"
;
}
}
}
// Return errno string (thread safe)
// Return errno string (thread safe)
...
...
include/spdlog/details/pattern_formatter_impl.h
View file @
d5a3bb52
...
@@ -662,10 +662,10 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
...
@@ -662,10 +662,10 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
inline
std
::
tm
spdlog
::
pattern_formatter
::
get_time
(
details
::
log_msg
&
msg
)
inline
std
::
tm
spdlog
::
pattern_formatter
::
get_time
(
details
::
log_msg
&
msg
)
{
{
if
(
_pattern_time
==
pattern_time_type
::
local
)
if
(
_pattern_time
==
pattern_time_type
::
local
)
{
return
details
::
os
::
localtime
(
log_clock
::
to_time_t
(
msg
.
time
));
return
details
::
os
::
localtime
(
log_clock
::
to_time_t
(
msg
.
time
));
else
}
return
details
::
os
::
gmtime
(
log_clock
::
to_time_t
(
msg
.
time
));
return
details
::
os
::
gmtime
(
log_clock
::
to_time_t
(
msg
.
time
));
}
}
inline
void
spdlog
::
pattern_formatter
::
format
(
details
::
log_msg
&
msg
)
inline
void
spdlog
::
pattern_formatter
::
format
(
details
::
log_msg
&
msg
)
...
...
include/spdlog/sinks/file_sinks.h
View file @
d5a3bb52
...
@@ -236,10 +236,10 @@ private:
...
@@ -236,10 +236,10 @@ private:
date
.
tm_min
=
_rotation_m
;
date
.
tm_min
=
_rotation_m
;
date
.
tm_sec
=
0
;
date
.
tm_sec
=
0
;
auto
rotation_time
=
std
::
chrono
::
system_clock
::
from_time_t
(
std
::
mktime
(
&
date
));
auto
rotation_time
=
std
::
chrono
::
system_clock
::
from_time_t
(
std
::
mktime
(
&
date
));
if
(
rotation_time
>
now
)
if
(
rotation_time
>
now
)
{
return
rotation_time
;
return
rotation_time
;
else
}
return
std
::
chrono
::
system_clock
::
time_point
(
rotation_time
+
std
::
chrono
::
hours
(
24
));
return
std
::
chrono
::
system_clock
::
time_point
(
rotation_time
+
std
::
chrono
::
hours
(
24
));
}
}
filename_t
_base_filename
;
filename_t
_base_filename
;
...
...
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