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
33329c80
Commit
33329c80
authored
Jul 22, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code formatting
parent
fe732554
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
logger_impl.h
include/spdlog/details/logger_impl.h
+0
-1
pattern_formatter.h
include/spdlog/details/pattern_formatter.h
+4
-4
registry.h
include/spdlog/details/registry.h
+5
-3
No files found.
include/spdlog/details/logger_impl.h
View file @
33329c80
...
...
@@ -37,7 +37,6 @@ inline spdlog::logger::logger(std::string logger_name, spdlog::sink_ptr single_s
inline
spdlog
::
logger
::~
logger
()
=
default
;
inline
void
spdlog
::
logger
::
set_formatter
(
std
::
unique_ptr
<
spdlog
::
formatter
>
f
)
{
for
(
auto
&
sink
:
sinks_
)
...
...
include/spdlog/details/pattern_formatter.h
View file @
33329c80
...
...
@@ -75,7 +75,7 @@ static int to12h(const tm &t)
}
// Abbreviated weekday name
static
const
char
*
days
[]{
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
static
const
char
*
days
[]{
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
class
a_formatter
:
public
flag_formatter
{
void
format
(
const
details
::
log_msg
&
,
const
std
::
tm
&
tm_time
,
fmt
::
memory_buffer
&
dest
)
override
...
...
@@ -85,7 +85,7 @@ class a_formatter : public flag_formatter
};
// Full weekday name
static
const
char
*
full_days
[]{
"Sunday"
,
"Monday"
,
"Tuesday"
,
"Wednesday"
,
"Thursday"
,
"Friday"
,
"Saturday"
};
static
const
char
*
full_days
[]{
"Sunday"
,
"Monday"
,
"Tuesday"
,
"Wednesday"
,
"Thursday"
,
"Friday"
,
"Saturday"
};
class
A_formatter
:
public
flag_formatter
{
void
format
(
const
details
::
log_msg
&
,
const
std
::
tm
&
tm_time
,
fmt
::
memory_buffer
&
dest
)
override
...
...
@@ -95,7 +95,7 @@ class A_formatter : public flag_formatter
};
// Abbreviated month
static
const
char
*
months
[]{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sept"
,
"Oct"
,
"Nov"
,
"Dec"
};
static
const
char
*
months
[]{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sept"
,
"Oct"
,
"Nov"
,
"Dec"
};
class
b_formatter
:
public
flag_formatter
{
void
format
(
const
details
::
log_msg
&
,
const
std
::
tm
&
tm_time
,
fmt
::
memory_buffer
&
dest
)
override
...
...
@@ -105,7 +105,7 @@ class b_formatter : public flag_formatter
};
// Full month name
static
const
char
*
full_months
[]{
static
const
char
*
full_months
[]{
"January"
,
"February"
,
"March"
,
"April"
,
"May"
,
"June"
,
"July"
,
"August"
,
"September"
,
"October"
,
"November"
,
"December"
};
class
B_formatter
:
public
flag_formatter
{
...
...
include/spdlog/details/registry.h
View file @
33329c80
...
...
@@ -81,7 +81,6 @@ public:
return
tp_
;
}
// Set global formatter. Each sink in each logger will get a clone of this object
void
set_formatter
(
std
::
unique_ptr
<
formatter
>
formatter
)
{
...
...
@@ -169,7 +168,10 @@ public:
}
private
:
registry_t
<
Mutex
>
()
:
formatter_
(
new
pattern_formatter
(
"%+"
)){}
registry_t
<
Mutex
>
()
:
formatter_
(
new
pattern_formatter
(
"%+"
))
{
}
~
registry_t
<
Mutex
>
()
{
...
...
@@ -196,7 +198,7 @@ private:
Mutex
loggers_mutex_
;
std
::
recursive_mutex
tp_mutex_
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
logger
>>
loggers_
;
//
std::unique_ptr<formatter> formatter_{ new pattern_formatter("%+") };
//
std::unique_ptr<formatter> formatter_{ new pattern_formatter("%+") };
std
::
unique_ptr
<
formatter
>
formatter_
;
level
::
level_enum
level_
=
level
::
info
;
level
::
level_enum
flush_level_
=
level
::
off
;
...
...
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