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
5f276971
Commit
5f276971
authored
Jul 10, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang-format
parent
261d2c5a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
11 deletions
+7
-11
bench/bench.cpp
bench/bench.cpp
+0
-1
example/example.cpp
example/example.cpp
+1
-0
include/spdlog/details/pattern_formatter-inl.h
include/spdlog/details/pattern_formatter-inl.h
+2
-4
include/spdlog/sinks/dup_filter_sink.h
include/spdlog/sinks/dup_filter_sink.h
+0
-1
include/spdlog/sinks/syslog_sink.h
include/spdlog/sinks/syslog_sink.h
+1
-1
include/spdlog/sinks/systemd_sink.h
include/spdlog/sinks/systemd_sink.h
+3
-4
No files found.
bench/bench.cpp
View file @
5f276971
...
@@ -39,7 +39,6 @@ int main(int argc, char *argv[])
...
@@ -39,7 +39,6 @@ int main(int argc, char *argv[])
size_t
file_size
=
30
*
1024
*
1024
;
size_t
file_size
=
30
*
1024
*
1024
;
size_t
rotating_files
=
5
;
size_t
rotating_files
=
5
;
try
try
{
{
...
...
example/example.cpp
View file @
5f276971
...
@@ -23,6 +23,7 @@ void clone_example();
...
@@ -23,6 +23,7 @@ void clone_example();
int
main
(
int
,
char
*
[])
int
main
(
int
,
char
*
[])
{
{
syslog_example
();
spdlog
::
info
(
"Welcome to spdlog version {}.{}.{} !"
,
SPDLOG_VER_MAJOR
,
SPDLOG_VER_MINOR
,
SPDLOG_VER_PATCH
);
spdlog
::
info
(
"Welcome to spdlog version {}.{}.{} !"
,
SPDLOG_VER_MAJOR
,
SPDLOG_VER_MINOR
,
SPDLOG_VER_PATCH
);
spdlog
::
warn
(
"Easy padding in numbers like {:08d}"
,
12
);
spdlog
::
warn
(
"Easy padding in numbers like {:08d}"
,
12
);
spdlog
::
critical
(
"Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}"
,
42
);
spdlog
::
critical
(
"Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}"
,
42
);
...
...
include/spdlog/details/pattern_formatter-inl.h
View file @
5f276971
...
@@ -892,13 +892,12 @@ public:
...
@@ -892,13 +892,12 @@ public:
template
<
typename
Units
>
template
<
typename
Units
>
class
elapsed_formatter
final
:
public
flag_formatter
class
elapsed_formatter
final
:
public
flag_formatter
{
{
public:
public:
using
DurationUnits
=
Units
;
using
DurationUnits
=
Units
;
explicit
elapsed_formatter
(
padding_info
padinfo
)
explicit
elapsed_formatter
(
padding_info
padinfo
)
:
flag_formatter
(
padinfo
)
,
:
flag_formatter
(
padinfo
)
last_message_time_
(
log_clock
::
now
())
,
last_message_time_
(
log_clock
::
now
())
{}
{}
void
format
(
const
details
::
log_msg
&
msg
,
const
std
::
tm
&
,
fmt
::
memory_buffer
&
dest
)
override
void
format
(
const
details
::
log_msg
&
msg
,
const
std
::
tm
&
,
fmt
::
memory_buffer
&
dest
)
override
...
@@ -919,7 +918,6 @@ public:
...
@@ -919,7 +918,6 @@ public:
protected:
protected:
log_clock
::
time_point
last_message_time_
;
log_clock
::
time_point
last_message_time_
;
};
};
// Full info formatter
// Full info formatter
...
...
include/spdlog/sinks/dup_filter_sink.h
View file @
5f276971
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
// [2019-06-25 17:50:56.512] [logger] [info] Skipped 3 duplicate messages..
// [2019-06-25 17:50:56.512] [logger] [info] Skipped 3 duplicate messages..
// [2019-06-25 17:50:56.512] [logger] [info] Different Hello
// [2019-06-25 17:50:56.512] [logger] [info] Different Hello
#ifdef SPDLOG_NO_DATETIME
#ifdef SPDLOG_NO_DATETIME
#error "spdlog::sinks::dup_filter_sink: cannot work when SPDLOG_NO_DATETIME is defined"
#error "spdlog::sinks::dup_filter_sink: cannot work when SPDLOG_NO_DATETIME is defined"
#endif
#endif
...
...
include/spdlog/sinks/syslog_sink.h
View file @
5f276971
...
@@ -61,7 +61,7 @@ protected:
...
@@ -61,7 +61,7 @@ protected:
size_t
length
=
payload
.
size
();
size_t
length
=
payload
.
size
();
// limit to max int
// limit to max int
if
(
length
>
std
::
numeric_limits
<
int
>::
max
())
if
(
length
>
std
::
numeric_limits
<
int
>::
max
())
{
{
length
=
std
::
numeric_limits
<
int
>::
max
();
length
=
std
::
numeric_limits
<
int
>::
max
();
}
}
...
...
include/spdlog/sinks/systemd_sink.h
View file @
5f276971
...
@@ -46,7 +46,7 @@ protected:
...
@@ -46,7 +46,7 @@ protected:
size_t
length
=
msg
.
payload
.
size
();
size_t
length
=
msg
.
payload
.
size
();
// limit to max int
// limit to max int
if
(
length
>
std
::
numeric_limits
<
int
>::
max
())
if
(
length
>
std
::
numeric_limits
<
int
>::
max
())
{
{
length
=
std
::
numeric_limits
<
int
>::
max
();
length
=
std
::
numeric_limits
<
int
>::
max
();
}
}
...
@@ -60,9 +60,8 @@ protected:
...
@@ -60,9 +60,8 @@ protected:
}
}
else
else
{
{
err
=
(
sd_journal_send
)(
"MESSAGE=%.*s"
,
static_cast
<
int
>
(
length
),
msg
.
payload
.
data
(),
"PRIORITY=%d"
,
err
=
(
sd_journal_send
)(
"MESSAGE=%.*s"
,
static_cast
<
int
>
(
length
),
msg
.
payload
.
data
(),
"PRIORITY=%d"
,
syslog_level
(
msg
.
level
),
syslog_level
(
msg
.
level
),
"SOURCE_FILE=%s"
,
msg
.
source
.
filename
,
"SOURCE_LINE=%d"
,
msg
.
source
.
line
,
"SOURCE_FUNC=%s"
,
"SOURCE_FILE=%s"
,
msg
.
source
.
filename
,
"SOURCE_LINE=%d"
,
msg
.
source
.
line
,
"SOURCE_FUNC=%s"
,
msg
.
source
.
funcname
,
nullptr
);
msg
.
source
.
funcname
,
nullptr
);
}
}
if
(
err
)
if
(
err
)
...
...
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