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
04530f24
Commit
04530f24
authored
6 years ago
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make spdlog auto flush all the time
parent
93eaa256
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
log2.h
jlib/log2.h
+6
-5
No files found.
jlib/log2.h
View file @
04530f24
...
@@ -39,7 +39,7 @@ public:
...
@@ -39,7 +39,7 @@ public:
#endif
#endif
#include "utf8.h"
#include "utf8.h"
namespace
jlib
{
namespace
jlib
{
static
const
char
g_logger_name
[]
=
"logger"
;
static
const
char
g_logger_name
[]
=
"logger"
;
...
@@ -61,6 +61,7 @@ inline void init_logger(const std::wstring& file_name = L"")
...
@@ -61,6 +61,7 @@ inline void init_logger(const std::wstring& file_name = L"")
auto
combined_logger
=
std
::
make_shared
<
spdlog
::
logger
>
(
g_logger_name
,
begin
(
sinks
),
end
(
sinks
));
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"
);
combined_logger
->
set_pattern
(
"[%Y-%m-%d %H:%M:%S.%e] [tid %t] [%L] %v"
);
spdlog
::
register_logger
(
combined_logger
);
spdlog
::
register_logger
(
combined_logger
);
combined_logger
->
flush_on
(
spdlog
::
level
::
off
);
}
catch
(
const
spdlog
::
spdlog_ex
&
ex
)
{
}
catch
(
const
spdlog
::
spdlog_ex
&
ex
)
{
#ifdef WIN32
#ifdef WIN32
char
msg
[
1024
]
=
{
0
};
char
msg
[
1024
]
=
{
0
};
...
@@ -76,10 +77,10 @@ inline void init_logger(const std::wstring& file_name = L"")
...
@@ -76,10 +77,10 @@ inline void init_logger(const std::wstring& file_name = L"")
#define JLOG_INFO spdlog::get(g_logger_name)->info
#define JLOG_INFO spdlog::get(
jlib::
g_logger_name)->info
#define JLOG_WARN spdlog::get(g_logger_name)->warn
#define JLOG_WARN spdlog::get(
jlib::
g_logger_name)->warn
#define JLOG_ERRO spdlog::get(g_logger_name)->error
#define JLOG_ERRO spdlog::get(
jlib::
g_logger_name)->error
#define JLOG_CRTC spdlog::get(g_logger_name)->critical
#define JLOG_CRTC spdlog::get(
jlib::
g_logger_name)->critical
#ifdef _WIN32
#ifdef _WIN32
#define JLOG_ALL(args, ...) spdlog::get(jlib::g_logger_name)->log(spdlog::level::off, args, __VA_ARGS__)
#define JLOG_ALL(args, ...) spdlog::get(jlib::g_logger_name)->log(spdlog::level::off, args, __VA_ARGS__)
...
...
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