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
fb702f98
Commit
fb702f98
authored
Jan 08, 2019
by
Ben Ridder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo in file_helper.h
* "extenstion" -> "extension"
parent
0203a0fd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
file_helper.h
include/spdlog/details/file_helper.h
+1
-1
daily_file_sink.h
include/spdlog/sinks/daily_file_sink.h
+1
-1
rotating_file_sink.h
include/spdlog/sinks/rotating_file_sink.h
+1
-1
test_file_helper.cpp
tests/test_file_helper.cpp
+2
-2
No files found.
include/spdlog/details/file_helper.h
View file @
fb702f98
...
...
@@ -122,7 +122,7 @@ public:
// ".mylog" => (".mylog". "")
// "my_folder/.mylog" => ("my_folder/.mylog", "")
// "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt")
static
std
::
tuple
<
filename_t
,
filename_t
>
split_by_extens
t
ion
(
const
spdlog
::
filename_t
&
fname
)
static
std
::
tuple
<
filename_t
,
filename_t
>
split_by_extension
(
const
spdlog
::
filename_t
&
fname
)
{
auto
ext_index
=
fname
.
rfind
(
'.'
);
...
...
include/spdlog/sinks/daily_file_sink.h
View file @
fb702f98
...
...
@@ -32,7 +32,7 @@ struct daily_filename_calculator
static
filename_t
calc_filename
(
const
filename_t
&
filename
,
const
tm
&
now_tm
)
{
filename_t
basename
,
ext
;
std
::
tie
(
basename
,
ext
)
=
details
::
file_helper
::
split_by_extens
t
ion
(
filename
);
std
::
tie
(
basename
,
ext
)
=
details
::
file_helper
::
split_by_extension
(
filename
);
std
::
conditional
<
std
::
is_same
<
filename_t
::
value_type
,
char
>::
value
,
fmt
::
memory_buffer
,
fmt
::
wmemory_buffer
>::
type
w
;
fmt
::
format_to
(
w
,
SPDLOG_FILENAME_T
(
"{}_{:04d}-{:02d}-{:02d}{}"
),
basename
,
now_tm
.
tm_year
+
1900
,
now_tm
.
tm_mon
+
1
,
now_tm
.
tm_mday
,
ext
);
...
...
include/spdlog/sinks/rotating_file_sink.h
View file @
fb702f98
...
...
@@ -48,7 +48,7 @@ public:
if
(
index
!=
0u
)
{
filename_t
basename
,
ext
;
std
::
tie
(
basename
,
ext
)
=
details
::
file_helper
::
split_by_extens
t
ion
(
filename
);
std
::
tie
(
basename
,
ext
)
=
details
::
file_helper
::
split_by_extension
(
filename
);
fmt
::
format_to
(
w
,
SPDLOG_FILENAME_T
(
"{}.{}{}"
),
basename
,
index
,
ext
);
}
else
...
...
tests/test_file_helper.cpp
View file @
fb702f98
...
...
@@ -81,12 +81,12 @@ static void test_split_ext(const char *fname, const char *expect_base, const cha
std
::
replace
(
expected_base
.
begin
(),
expected_base
.
end
(),
'/'
,
'\\'
);
#endif
spdlog
::
filename_t
basename
,
ext
;
std
::
tie
(
basename
,
ext
)
=
file_helper
::
split_by_extens
t
ion
(
filename
);
std
::
tie
(
basename
,
ext
)
=
file_helper
::
split_by_extension
(
filename
);
REQUIRE
(
basename
==
expected_base
);
REQUIRE
(
ext
==
expected_ext
);
}
TEST_CASE
(
"file_helper_split_by_extens
tion"
,
"[file_helper::split_by_extenst
ion()]]"
)
TEST_CASE
(
"file_helper_split_by_extens
ion"
,
"[file_helper::split_by_extens
ion()]]"
)
{
test_split_ext
(
"mylog.txt"
,
"mylog"
,
".txt"
);
test_split_ext
(
".mylog.txt"
,
".mylog"
,
".txt"
);
...
...
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