Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
jlib
Commits
576f8a37
Commit
576f8a37
authored
6 years ago
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix log2 for unix
parent
11216891
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
log2.h
jlib/log2.h
+14
-2
No files found.
jlib/log2.h
View file @
576f8a37
...
...
@@ -47,7 +47,13 @@ namespace jlib {
static
constexpr
char
g_logger_name
[]
=
"jlogger"
;
inline
void
init_logger
(
const
std
::
wstring
&
file_name
=
L""
)
inline
void
init_logger
(
const
#ifdef WIN32
std
::
wstring
#else
std
::
string
#endif
&
file_name
=
L""
)
{
try
{
std
::
vector
<
spdlog
::
sink_ptr
>
sinks
;
...
...
@@ -55,7 +61,13 @@ inline void init_logger(const std::wstring& file_name = L"")
sinks
.
push_back
(
std
::
make_shared
<
spdlog
::
sinks
::
msvc_sink_mt
>
());
#endif
sinks
.
push_back
(
std
::
make_shared
<
spdlog
::
sinks
::
stdout_sink_mt
>
());
sinks
.
push_back
(
std
::
make_shared
<
spdlog
::
sinks
::
daily_file_sink_mt
>
(
file_name
+
L".log"
,
23
,
59
));
sinks
.
push_back
(
std
::
make_shared
<
spdlog
::
sinks
::
daily_file_sink_mt
>
(
#ifdef WIN32
file_name
+
L".log"
#else
file_name
+
".log"
#endif
,
23
,
59
));
auto
combined_logger
=
std
::
make_shared
<
spdlog
::
logger
>
(
g_logger_name
,
begin
(
sinks
),
end
(
sinks
));
combined_logger
->
set_pattern
(
"[%Y-%m-%d %H:%M:%S.%e] [tid %t] [%L] %v"
);
...
...
This diff is collapsed.
Click to expand it.
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