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
b3050aa8
Commit
b3050aa8
authored
Aug 04, 2015
by
Radu Popescu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue 115 Nanosecond resolution timestamps
parent
5fc6002f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+14
-0
No files found.
include/spdlog/details/pattern_formatter_impl.h
View file @
b3050aa8
...
...
@@ -265,6 +265,17 @@ class f_formatter :public flag_formatter
}
};
// nanoseconds
class
F_formatter
:
public
flag_formatter
{
void
format
(
details
::
log_msg
&
msg
,
const
std
::
tm
&
)
override
{
auto
duration
=
msg
.
time
.
time_since_epoch
();
auto
ns
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
nanoseconds
>
(
duration
).
count
()
%
1000000000
;
msg
.
formatted
<<
fmt
::
pad
(
static_cast
<
int
>
(
ns
),
9
,
'0'
);
}
};
// AM/PM
class
p_formatter
:
public
flag_formatter
{
...
...
@@ -575,6 +586,9 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
case
(
'f'
)
:
_formatters
.
push_back
(
std
::
unique_ptr
<
details
::
flag_formatter
>
(
new
details
::
f_formatter
()));
break
;
case
(
'F'
)
:
_formatters
.
push_back
(
std
::
unique_ptr
<
details
::
flag_formatter
>
(
new
details
::
F_formatter
()));
break
;
case
(
'p'
)
:
_formatters
.
push_back
(
std
::
unique_ptr
<
details
::
flag_formatter
>
(
new
details
::
p_formatter
()));
...
...
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