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
4fdcfa5b
Commit
4fdcfa5b
authored
Jul 14, 2016
by
Dominik Charousset
Committed by
GitHub
Jul 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #489 from alexeiz/develop
Respect CAF_LOG_LEVEL
parents
aa516656
e7c0fe22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
9 deletions
+30
-9
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+24
-3
libcaf_core/src/logger.cpp
libcaf_core/src/logger.cpp
+6
-6
No files found.
libcaf_core/caf/logger.hpp
View file @
4fdcfa5b
...
...
@@ -274,11 +274,32 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
#endif // CAF_LOG_LEVEL < CAF_LOG_LEVEL_TRACE
#if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG
# define CAF_LOG_DEBUG(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_DEBUG, output)
#endif
#if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_INFO
# define CAF_LOG_INFO(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_INFO, output)
#endif
#if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_WARNING
# define CAF_LOG_WARNING(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_WARNING, output)
#endif
#endif // CAF_LOG_LEVEL
#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_WARNING(output) CAF_LOG_IMPL(CAF_LOG_LEVEL_WARNING, output)
#ifndef CAF_LOG_INFO
# define CAF_LOG_INFO(output) CAF_VOID_STMT
#endif
#ifndef CAF_LOG_DEBUG
# define CAF_LOG_DEBUG(output) CAF_VOID_STMT
#endif
#ifndef CAF_LOG_WARNING
# define CAF_LOG_WARNING(output) CAF_VOID_STMT
#endif
#define CAF_LOG_ERROR(output) \
do { \
CAF_PRINT_ERROR_IMPL(CAF_GET_CLASS_NAME, __func__, output); \
...
...
libcaf_core/src/logger.cpp
View file @
4fdcfa5b
...
...
@@ -294,22 +294,22 @@ void logger::run() {
}
void
logger
::
start
()
{
#
ifdef CAF_LOG_LEVEL
#
if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_INFO
const
char
*
log_level_table
[]
=
{
"ERROR"
,
"WARN"
,
"INFO"
,
"DEBUG"
,
"TRACE"
};
thread_
=
std
::
thread
{[
this
]
{
this
->
run
();
}};
std
::
string
msg
=
"ENTRY log level = "
;
msg
+=
log_level_table
[
global_log_level
];
log
(
4
,
"caf"
,
"caf::logger"
,
"run"
,
__FILE__
,
__LINE__
,
msg
);
#
endif
log
(
CAF_LOG_LEVEL_INFO
,
"caf"
,
"caf::logger"
,
"run"
,
__FILE__
,
__LINE__
,
msg
);
#endif
}
void
logger
::
stop
()
{
#
ifdef CAF_LOG_LEVEL
log
(
4
,
"caf"
,
"caf::logger"
,
"run"
,
__FILE__
,
__LINE__
,
"EXIT"
);
#
if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_INFO
log
(
CAF_LOG_LEVEL_INFO
,
"caf"
,
"caf::logger"
,
"run"
,
__FILE__
,
__LINE__
,
"EXIT"
);
// an empty string means: shut down
queue_
.
synchronized_enqueue
(
queue_mtx_
,
queue_cv_
,
new
event
{
""
});
thread_
.
join
();
#
endif
#endif
}
}
// namespace caf
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