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
b7a66594
Commit
b7a66594
authored
Oct 03, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code formatting
parent
102c31a0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
11 deletions
+7
-11
logger_impl.h
include/spdlog/details/logger_impl.h
+3
-4
logger.h
include/spdlog/logger.h
+1
-1
test_fmt_helper.cpp
tests/test_fmt_helper.cpp
+3
-6
No files found.
include/spdlog/details/logger_impl.h
View file @
b7a66594
...
...
@@ -185,7 +185,7 @@ inline void wbuf_to_utf8buf(const fmt::wmemory_buffer &wbuf, fmt::memory_buffer
}
auto
result_size
=
::
WideCharToMultiByte
(
CP_UTF8
,
0
,
wbuf
.
data
(),
wbuf_size
,
NULL
,
0
,
NULL
,
NULL
);
if
(
result_size
>
0
)
{
target
.
resize
(
result_size
);
...
...
@@ -197,7 +197,6 @@ inline void wbuf_to_utf8buf(const fmt::wmemory_buffer &wbuf, fmt::memory_buffer
}
}
template
<
typename
...
Args
>
inline
void
spdlog
::
logger
::
log
(
level
::
level_enum
lvl
,
const
wchar_t
*
fmt
,
const
Args
&
...
args
)
{
...
...
@@ -208,10 +207,10 @@ inline void spdlog::logger::log(level::level_enum lvl, const wchar_t *fmt, const
try
{
// format to wmemory_buffer and convert to utf8
// format to wmemory_buffer and convert to utf8
details
::
log_msg
log_msg
(
&
name_
,
lvl
);
fmt
::
wmemory_buffer
wbuf
;
fmt
::
format_to
(
wbuf
,
fmt
,
args
...);
fmt
::
format_to
(
wbuf
,
fmt
,
args
...);
wbuf_to_utf8buf
(
wbuf
,
log_msg
.
raw
);
sink_it_
(
log_msg
);
}
...
...
include/spdlog/logger.h
View file @
b7a66594
...
...
@@ -22,10 +22,10 @@
#include "spdlog/formatter.h"
#include "spdlog/sinks/sink.h"
#include <locale>
#include <memory>
#include <string>
#include <vector>
#include <locale>
namespace
spdlog
{
...
...
tests/test_fmt_helper.cpp
View file @
b7a66594
#include "includes.h"
void
test_pad2
(
int
n
,
const
char
*
expected
)
void
test_pad2
(
int
n
,
const
char
*
expected
)
{
fmt
::
memory_buffer
buf
;
spdlog
::
details
::
fmt_helper
::
pad2
(
n
,
buf
);
REQUIRE
(
fmt
::
to_string
(
buf
)
==
expected
);
}
void
test_pad3
(
int
n
,
const
char
*
expected
)
void
test_pad3
(
int
n
,
const
char
*
expected
)
{
fmt
::
memory_buffer
buf
;
spdlog
::
details
::
fmt_helper
::
pad3
(
n
,
buf
);
REQUIRE
(
fmt
::
to_string
(
buf
)
==
expected
);
}
void
test_pad6
(
std
::
size_t
n
,
const
char
*
expected
)
void
test_pad6
(
std
::
size_t
n
,
const
char
*
expected
)
{
fmt
::
memory_buffer
buf
;
spdlog
::
details
::
fmt_helper
::
pad6
(
n
,
buf
);
REQUIRE
(
fmt
::
to_string
(
buf
)
==
expected
);
}
TEST_CASE
(
"pad2"
,
"[fmt_helper]"
)
{
test_pad2
(
0
,
"00"
);
...
...
@@ -43,7 +42,6 @@ TEST_CASE("pad3", "[fmt_helper]")
test_pad3
(
-
5
,
"-05"
);
}
TEST_CASE
(
"pad6"
,
"[fmt_helper]"
)
{
test_pad6
(
0
,
"000000"
);
...
...
@@ -54,4 +52,3 @@ TEST_CASE("pad6", "[fmt_helper]")
test_pad6
(
12345
,
"012345"
);
test_pad6
(
123456
,
"123456"
);
}
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