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
98e4eb98
Commit
98e4eb98
authored
Dec 03, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small optimization in default formatting (unsigned ints)
parent
9e882c4d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
include/spdlog/details/pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+9
-9
No files found.
include/spdlog/details/pattern_formatter_impl.h
View file @
98e4eb98
...
...
@@ -345,7 +345,7 @@ class v_formatter :public flag_formatter
{
void
format
(
details
::
log_msg
&
msg
)
override
{
msg
.
formatted
<<
fmt
::
BasicStringRef
<
char
>
(
msg
.
raw
.
data
(),
msg
.
raw
.
size
());
msg
.
formatted
<<
fmt
::
StringRef
(
msg
.
raw
.
data
(),
msg
.
raw
.
size
());
}
};
...
...
@@ -404,16 +404,16 @@ class full_formatter :public flag_formatter
msg.raw.str());*/
// Faster (albeit uglier) way to format the line (5.6 million lines/sec under 10 threads)
msg
.
formatted
<<
'['
<<
msg
.
tm_time
.
tm_year
+
1900
<<
'-'
<<
fmt
::
pad
(
msg
.
tm_time
.
tm_mon
+
1
,
2
,
'0'
)
<<
'-'
<<
fmt
::
pad
(
msg
.
tm_time
.
tm_mday
,
2
,
'0'
)
<<
' '
<<
fmt
::
pad
(
msg
.
tm_time
.
tm_hour
,
2
,
'0'
)
<<
':'
<<
fmt
::
pad
(
msg
.
tm_time
.
tm_min
,
2
,
'0'
)
<<
':'
<<
fmt
::
pad
(
msg
.
tm_time
.
tm_sec
,
2
,
'0'
)
<<
'.'
<<
fmt
::
pad
(
static_cast
<
int
>
(
millis
),
3
,
'0'
)
<<
"] "
;
msg
.
formatted
<<
'['
<<
static_cast
<
unsigned
int
>
(
msg
.
tm_time
.
tm_year
+
1900
)
<<
'-'
<<
fmt
::
pad
(
static_cast
<
unsigned
int
>
(
msg
.
tm_time
.
tm_mon
+
1
)
,
2
,
'0'
)
<<
'-'
<<
fmt
::
pad
(
static_cast
<
unsigned
int
>
(
msg
.
tm_time
.
tm_mday
)
,
2
,
'0'
)
<<
' '
<<
fmt
::
pad
(
static_cast
<
unsigned
int
>
(
msg
.
tm_time
.
tm_hour
)
,
2
,
'0'
)
<<
':'
<<
fmt
::
pad
(
static_cast
<
unsigned
int
>
(
msg
.
tm_time
.
tm_min
)
,
2
,
'0'
)
<<
':'
<<
fmt
::
pad
(
static_cast
<
unsigned
int
>
(
msg
.
tm_time
.
tm_sec
)
,
2
,
'0'
)
<<
'.'
<<
fmt
::
pad
(
static_cast
<
unsigned
int
>
(
millis
),
3
,
'0'
)
<<
"] "
;
msg
.
formatted
<<
'['
<<
msg
.
logger_name
<<
"] ["
<<
level
::
to_str
(
msg
.
level
)
<<
"] "
;
msg
.
formatted
<<
fmt
::
BasicStringRef
<
char
>
(
msg
.
raw
.
data
(),
msg
.
raw
.
size
());
msg
.
formatted
<<
fmt
::
StringRef
(
msg
.
raw
.
data
(),
msg
.
raw
.
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