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
887326e7
Commit
887326e7
authored
Jul 08, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor code cleanup
parent
45da6c9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
21 deletions
+7
-21
include/spdlog/common.h
include/spdlog/common.h
+2
-2
include/spdlog/details/pattern_formatter.h
include/spdlog/details/pattern_formatter.h
+4
-8
include/spdlog/sinks/sink.h
include/spdlog/sinks/sink.h
+1
-11
No files found.
include/spdlog/common.h
View file @
887326e7
...
...
@@ -127,8 +127,8 @@ using level_hasher = std::hash<int>;
//
enum
class
async_overflow_policy
{
block
,
// Block until message can be enqueued
overrun_oldest
// Discard oldest message in the queue if full when trying to add new item.
block
,
// Block until message can be enqueued
overrun_oldest
// Discard oldest message in the queue if full when trying to add new item.
};
//
...
...
include/spdlog/details/pattern_formatter.h
View file @
887326e7
...
...
@@ -329,23 +329,19 @@ public:
int
total_minutes
=
os
::
utc_minutes_offset
(
tm_time
);
#endif
bool
is_negative
=
total_minutes
<
0
;
char
sign
;
if
(
is_negative
)
{
total_minutes
=
-
total_minutes
;
sign
=
'-'
;
dest
.
push_back
(
'-'
)
;
}
else
{
sign
=
'+'
;
dest
.
push_back
(
'+'
)
;
}
int
h
=
total_minutes
/
60
;
int
m
=
total_minutes
%
60
;
dest
.
push_back
(
sign
);
fmt_helper
::
pad2
(
h
,
dest
);
fmt_helper
::
pad2
(
total_minutes
/
60
,
dest
);
//hours
dest
.
push_back
(
':'
);
fmt_helper
::
pad2
(
m
,
dest
);
fmt_helper
::
pad2
(
total_minutes
%
60
,
dest
);
//minutes
}
private:
...
...
include/spdlog/sinks/sink.h
View file @
887326e7
...
...
@@ -19,17 +19,7 @@ public:
:
formatter_
(
std
::
unique_ptr
<
spdlog
::
formatter
>
(
new
pattern_formatter
(
"%+"
)))
{
}
//
// explicit sink(const std::string &formatter_pattern)
// : formatter_(std::unique_ptr<spdlog::formatter>(new pattern_formatter(formatter_pattern)))
// {
// }
//
// // sink with custom formatter
// explicit sink(std::unique_ptr<spdlog::formatter> sink_formatter)
// : formatter_(std::move(sink_formatter))
// {
// }
virtual
~
sink
()
=
default
;
...
...
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