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
95de24e4
Commit
95de24e4
authored
Jul 04, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed tests and renamed to_short_str
parent
1d9e2304
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
common.h
include/spdlog/common.h
+1
-1
pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+1
-1
test_misc.cpp
tests/test_misc.cpp
+16
-16
No files found.
include/spdlog/common.h
View file @
95de24e4
...
...
@@ -99,7 +99,7 @@ inline const char *to_c_str(spdlog::level::level_enum l)
return
level_names
[
l
];
}
inline
const
char
*
to_short_str
(
spdlog
::
level
::
level_enum
l
)
inline
const
char
*
to_short_
c_
str
(
spdlog
::
level
::
level_enum
l
)
{
return
short_level_names
[
l
];
}
...
...
include/spdlog/details/pattern_formatter_impl.h
View file @
95de24e4
...
...
@@ -56,7 +56,7 @@ class short_level_formatter : public flag_formatter
{
void
format
(
const
details
::
log_msg
&
msg
,
const
std
::
tm
&
,
fmt
::
memory_buffer
&
dest
)
override
{
fmt_helper
::
append_c_str
(
level
::
to_short_str
(
msg
.
level
),
dest
);
fmt_helper
::
append_c_str
(
level
::
to_short_
c_
str
(
msg
.
level
),
dest
);
}
};
...
...
tests/test_misc.cpp
View file @
95de24e4
...
...
@@ -42,26 +42,26 @@ TEST_CASE("log_levels", "[log_levels]")
REQUIRE
(
log_info
(
"Hello"
,
spdlog
::
level
::
trace
)
==
"Hello"
);
}
TEST_CASE
(
"to_
str"
,
"[convert_to
_str]"
)
TEST_CASE
(
"to_
c_str"
,
"[convert_to_c
_str]"
)
{
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_str
(
spdlog
::
level
::
trace
))
==
"trace"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_str
(
spdlog
::
level
::
debug
))
==
"debug"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_str
(
spdlog
::
level
::
info
))
==
"info"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_str
(
spdlog
::
level
::
warn
))
==
"warning"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_str
(
spdlog
::
level
::
err
))
==
"error"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_str
(
spdlog
::
level
::
critical
))
==
"critical"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_str
(
spdlog
::
level
::
off
))
==
"off"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_
c_
str
(
spdlog
::
level
::
trace
))
==
"trace"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_
c_
str
(
spdlog
::
level
::
debug
))
==
"debug"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_
c_
str
(
spdlog
::
level
::
info
))
==
"info"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_
c_
str
(
spdlog
::
level
::
warn
))
==
"warning"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_
c_
str
(
spdlog
::
level
::
err
))
==
"error"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_
c_
str
(
spdlog
::
level
::
critical
))
==
"critical"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_
c_
str
(
spdlog
::
level
::
off
))
==
"off"
);
}
TEST_CASE
(
"to_short_
str"
,
"[convert_to_short
_str]"
)
TEST_CASE
(
"to_short_
c_str"
,
"[convert_to_short_c
_str]"
)
{
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_str
(
spdlog
::
level
::
trace
))
==
"T"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_str
(
spdlog
::
level
::
debug
))
==
"D"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_str
(
spdlog
::
level
::
info
))
==
"I"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_str
(
spdlog
::
level
::
warn
))
==
"W"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_str
(
spdlog
::
level
::
err
))
==
"E"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_str
(
spdlog
::
level
::
critical
))
==
"C"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_str
(
spdlog
::
level
::
off
))
==
"O"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_
c_
str
(
spdlog
::
level
::
trace
))
==
"T"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_
c_
str
(
spdlog
::
level
::
debug
))
==
"D"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_
c_
str
(
spdlog
::
level
::
info
))
==
"I"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_
c_
str
(
spdlog
::
level
::
warn
))
==
"W"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_
c_
str
(
spdlog
::
level
::
err
))
==
"E"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_
c_
str
(
spdlog
::
level
::
critical
))
==
"C"
);
REQUIRE
(
std
::
string
(
spdlog
::
level
::
to_short_
c_
str
(
spdlog
::
level
::
off
))
==
"O"
);
}
TEST_CASE
(
"to_level_enum"
,
"[convert_to_level_enum]"
)
...
...
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