Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
0a25eb73
Commit
0a25eb73
authored
Dec 03, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print errors even when compiling without logging
parent
f2eb92d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+16
-18
No files found.
libcaf_core/caf/logger.hpp
View file @
0a25eb73
...
@@ -191,19 +191,24 @@ private:
...
@@ -191,19 +191,24 @@ private:
#define CAF_UNIFYN(NAME) CAF_CONCAT(NAME, __LINE__)
#define CAF_UNIFYN(NAME) CAF_CONCAT(NAME, __LINE__)
#define CAF_PRINT_ERROR_IMPL(nclass, nfun, message) \
#define CAF_PRINT_ERROR_IMPL(nclass, nfun, message) \
{
\
do {
\
caf::logger::line_builder lb; \
caf::logger::line_builder lb;
\
lb << message; \
lb << message; \
if (nclass.empty()) \
if (nclass.empty()) \
printf("[ERROR] %s::%s: %s\n", nclass.c_str(), nfun, lb.get().c_str()); \
printf("[ERROR] %s::%s: %s\n", nclass.c_str(), nfun, lb.get().c_str()); \
else \
else \
printf("[ERROR] %s: %s\n", nfun, lb.get().c_str()); \
printf("[ERROR] %s: %s\n", nfun, lb.get().c_str()); \
} \
} while (false)
CAF_VOID_STMT
#
ifndef CAF_LOG_LEVEL
#
define CAF_ARG(argument) caf::logger::make_arg_wrapper(#argument, argument)
#define CAF_ARG(unused)
#ifdef CAF_MSVC
#define CAF_GET_CLASS_NAME caf::logger::extract_class_name(__FUNCSIG__)
#else // CAF_MSVC
#define CAF_GET_CLASS_NAME caf::logger::extract_class_name(__PRETTY_FUNCTION__)
#endif // CAF_MSVC
#ifndef CAF_LOG_LEVEL
#define CAF_LOG_IMPL(unused1, unused2)
#define CAF_LOG_IMPL(unused1, unused2)
...
@@ -222,18 +227,7 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
...
@@ -222,18 +227,7 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
#else // CAF_LOG_LEVEL
#else // CAF_LOG_LEVEL
#define CAF_ARG(argument) caf::logger::make_arg_wrapper(#argument, argument)
#ifdef CAF_MSVC
#define CAF_GET_CLASS_NAME caf::logger::extract_class_name(__FUNCSIG__)
#else // CAF_MSVC
#define CAF_GET_CLASS_NAME caf::logger::extract_class_name(__PRETTY_FUNCTION__)
#endif // CAF_MSVC
#define CAF_LOG_IMPL(loglvl, message) \
#define CAF_LOG_IMPL(loglvl, message) \
if (loglvl == 0) { \
CAF_PRINT_ERROR_IMPL(CAF_GET_CLASS_NAME, __func__, message); \
} \
caf::logger::log_static(loglvl, CAF_GET_CLASS_NAME, __func__, \
caf::logger::log_static(loglvl, CAF_GET_CLASS_NAME, __func__, \
__FILE__, __LINE__, \
__FILE__, __LINE__, \
(caf::logger::line_builder{} << message).get())
(caf::logger::line_builder{} << message).get())
...
@@ -282,7 +276,11 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
...
@@ -282,7 +276,11 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
#define CAF_LOG_DEBUG(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_DEBUG, output)
#define CAF_LOG_DEBUG(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_DEBUG, output)
#define CAF_LOG_INFO(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_INFO, output)
#define CAF_LOG_INFO(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_INFO, output)
#define CAF_LOG_WARNING(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_WARNING, output)
#define CAF_LOG_WARNING(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_WARNING, output)
#define CAF_LOG_ERROR(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_ERROR, output)
#define CAF_LOG_ERROR(output) \
do { \
CAF_PRINT_ERROR_IMPL(CAF_GET_CLASS_NAME, __func__, output); \
CAF_LOG_IMPL(CAF_LOG_LEVEL_ERROR, output); \
} while (false)
#ifdef CAF_LOG_LEVEL
#ifdef CAF_LOG_LEVEL
...
...
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