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
9e19012c
Unverified
Commit
9e19012c
authored
Jan 10, 2021
by
Charles Milette
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove filename_memory_buf_t from headers
parent
1234cda3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
include/spdlog/common.h
include/spdlog/common.h
+0
-1
tests/test_daily_logger.cpp
tests/test_daily_logger.cpp
+5
-3
No files found.
include/spdlog/common.h
View file @
9e19012c
...
...
@@ -104,7 +104,6 @@ using string_view_t = fmt::basic_string_view<char>;
using
wstring_view_t
=
fmt
::
basic_string_view
<
wchar_t
>
;
using
memory_buf_t
=
fmt
::
basic_memory_buffer
<
char
,
250
>
;
using
wmemory_buf_t
=
fmt
::
basic_memory_buffer
<
wchar_t
,
250
>
;
using
filename_memory_buf_t
=
fmt
::
basic_memory_buffer
<
filename_t
::
value_type
,
250
>
;
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
#ifndef _WIN32
...
...
tests/test_daily_logger.cpp
View file @
9e19012c
...
...
@@ -3,6 +3,8 @@
*/
#include "includes.h"
using
filename_memory_buf_t
=
fmt
::
basic_memory_buffer
<
spdlog
::
filename_t
::
value_type
,
250
>
;
TEST_CASE
(
"daily_logger with dateonly calculator"
,
"[daily_logger]"
)
{
using
sink_type
=
spdlog
::
sinks
::
daily_file_sink
<
std
::
mutex
,
spdlog
::
sinks
::
daily_filename_calculator
>
;
...
...
@@ -12,7 +14,7 @@ TEST_CASE("daily_logger with dateonly calculator", "[daily_logger]")
// calculate filename (time based)
spdlog
::
filename_t
basename
=
SPDLOG_FILENAME_T
(
"test_logs/daily_dateonly"
);
std
::
tm
tm
=
spdlog
::
details
::
os
::
localtime
();
spdlog
::
filename_memory_buf_t
w
;
filename_memory_buf_t
w
;
fmt
::
format_to
(
w
,
SPDLOG_FILENAME_T
(
"{}_{:04d}-{:02d}-{:02d}"
),
basename
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
);
auto
logger
=
spdlog
::
create
<
sink_type
>
(
"logger"
,
basename
,
0
,
0
);
...
...
@@ -37,7 +39,7 @@ struct custom_daily_file_name_calculator
{
static
spdlog
::
filename_t
calc_filename
(
const
spdlog
::
filename_t
&
basename
,
const
tm
&
now_tm
)
{
spdlog
::
filename_memory_buf_t
w
;
filename_memory_buf_t
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
);
return
fmt
::
to_string
(
w
);
}
...
...
@@ -52,7 +54,7 @@ TEST_CASE("daily_logger with custom calculator", "[daily_logger]")
// calculate filename (time based)
spdlog
::
filename_t
basename
=
SPDLOG_FILENAME_T
(
"test_logs/daily_dateonly"
);
std
::
tm
tm
=
spdlog
::
details
::
os
::
localtime
();
spdlog
::
filename_memory_buf_t
w
;
filename_memory_buf_t
w
;
fmt
::
format_to
(
w
,
SPDLOG_FILENAME_T
(
"{}{:04d}{:02d}{:02d}"
),
basename
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
);
auto
logger
=
spdlog
::
create
<
sink_type
>
(
"logger"
,
basename
,
0
,
0
);
...
...
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