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
38f6b5ea
Commit
38f6b5ea
authored
Jun 03, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep clang-tidy happy
parent
c000a616
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
15 deletions
+19
-15
.clang-tidy
.clang-tidy
+1
-1
include/spdlog/details/file_helper.h
include/spdlog/details/file_helper.h
+2
-2
include/spdlog/details/os-inl.h
include/spdlog/details/os-inl.h
+3
-2
include/spdlog/details/pattern_formatter-inl.h
include/spdlog/details/pattern_formatter-inl.h
+9
-7
include/spdlog/logger.h
include/spdlog/logger.h
+3
-2
include/spdlog/sinks/ansicolor_sink.h
include/spdlog/sinks/ansicolor_sink.h
+1
-1
No files found.
.clang-tidy
View file @
38f6b5ea
Checks: 'modernize-*,modernize-use-override,google-*,-google-runtime-references,misc-*,clang-analyzer-*'
Checks: 'modernize-*,modernize-use-override,google-*,-google-runtime-references,misc-*,clang-analyzer-*
,-misc-non-private-member-variables-in-classes
'
WarningsAsErrors: ''
HeaderFilterRegex: 'async.h|async_logger.h|common.h|details|formatter.h|logger.h|sinks|spdlog.h|tweakme.h|version.h'
AnalyzeTemporaryDtors: false
...
...
include/spdlog/details/file_helper.h
View file @
38f6b5ea
...
...
@@ -16,8 +16,6 @@ namespace details {
class
file_helper
{
public:
const
int
open_tries
=
5
;
const
int
open_interval
=
10
;
explicit
file_helper
()
=
default
;
file_helper
(
const
file_helper
&
)
=
delete
;
...
...
@@ -49,6 +47,8 @@ public:
static
std
::
tuple
<
filename_t
,
filename_t
>
split_by_extension
(
const
filename_t
&
fname
);
private:
const
int
open_tries
=
5
;
const
int
open_interval
=
10
;
std
::
FILE
*
fd_
{
nullptr
};
filename_t
_filename
;
};
...
...
include/spdlog/details/os-inl.h
View file @
38f6b5ea
...
...
@@ -15,6 +15,7 @@
#include <ctime>
#include <string>
#include <thread>
#include <array>
#include <sys/stat.h>
#include <sys/types.h>
...
...
@@ -370,7 +371,7 @@ SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT
#ifdef _WIN32
return
true
;
#else
static
constexpr
const
char
*
Terms
[]
=
{
static
constexpr
std
::
array
<
const
char
*
,
14
>
Terms
=
{
"ansi"
,
"color"
,
"console"
,
"cygwin"
,
"gnome"
,
"konsole"
,
"kterm"
,
"linux"
,
"msys"
,
"putty"
,
"rxvt"
,
"screen"
,
"vt100"
,
"xterm"
};
const
char
*
env_p
=
std
::
getenv
(
"TERM"
);
...
...
include/spdlog/details/pattern_formatter-inl.h
View file @
38f6b5ea
...
...
@@ -163,7 +163,7 @@ static int to12h(const tm &t)
}
// Abbreviated weekday name
static
const
char
*
days
[]
{
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
static
std
::
array
<
const
char
*
,
7
>
days
{
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
class
a_formatter
:
public
flag_formatter
{
public:
...
...
@@ -180,7 +180,7 @@ public:
};
// Full weekday name
static
const
char
*
full_days
[]
{
"Sunday"
,
"Monday"
,
"Tuesday"
,
"Wednesday"
,
"Thursday"
,
"Friday"
,
"Saturday"
};
static
std
::
array
<
const
char
*
,
7
>
full_days
{
"Sunday"
,
"Monday"
,
"Tuesday"
,
"Wednesday"
,
"Thursday"
,
"Friday"
,
"Saturday"
};
class
A_formatter
:
public
flag_formatter
{
public:
...
...
@@ -197,7 +197,7 @@ public:
};
// Abbreviated month
static
const
char
*
months
[]
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sept"
,
"Oct"
,
"Nov"
,
"Dec"
};
static
const
std
::
array
<
const
char
*
,
12
>
months
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sept"
,
"Oct"
,
"Nov"
,
"Dec"
};
class
b_formatter
:
public
flag_formatter
{
public:
...
...
@@ -214,8 +214,9 @@ public:
};
// Full month name
static
const
char
*
full_months
[]
{
static
const
std
::
array
<
const
char
*
,
12
>
full_months
{
"January"
,
"February"
,
"March"
,
"April"
,
"May"
,
"June"
,
"July"
,
"August"
,
"September"
,
"October"
,
"November"
,
"December"
};
class
B_formatter
:
public
flag_formatter
{
public:
...
...
@@ -575,7 +576,7 @@ public:
explicit
z_formatter
(
padding_info
padinfo
)
:
flag_formatter
(
padinfo
){}
const
std
::
chrono
::
seconds
cache_refresh
=
std
::
chrono
::
seconds
(
5
);
z_formatter
()
=
default
;
z_formatter
(
const
z_formatter
&
)
=
delete
;
...
...
@@ -617,7 +618,8 @@ private:
int
get_cached_offset
(
const
log_msg
&
msg
,
const
std
::
tm
&
tm_time
)
{
if
(
msg
.
time
-
last_update_
>=
cache_refresh
)
// refresh every 10 seconds
if
(
msg
.
time
-
last_update_
>=
std
::
chrono
::
seconds
(
10
))
{
offset_minutes_
=
os
::
utc_minutes_offset
(
tm_time
);
last_update_
=
msg
.
time
;
...
...
include/spdlog/logger.h
View file @
38f6b5ea
...
...
@@ -32,9 +32,10 @@ class logger
{
public:
// Empty logger
logger
(
std
::
string
name
)
:
explicit
logger
(
std
::
string
name
)
:
name_
(
std
::
move
(
name
)),
sinks_
(){}
sinks_
()
{}
// Logger with range on sinks
template
<
typename
It
>
...
...
include/spdlog/sinks/ansicolor_sink.h
View file @
38f6b5ea
...
...
@@ -29,7 +29,7 @@ class ansicolor_sink final : public sink
{
public:
using
mutex_t
=
typename
ConsoleMutex
::
mutex_t
;
ansicolor_sink
(
color_mode
mode
=
color_mode
::
automatic
);
explicit
ansicolor_sink
(
color_mode
mode
=
color_mode
::
automatic
);
~
ansicolor_sink
()
override
=
default
;
ansicolor_sink
(
const
ansicolor_sink
&
other
)
=
delete
;
...
...
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