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
eabbc579
Unverified
Commit
eabbc579
authored
Aug 08, 2018
by
Dominik Charousset
Committed by
GitHub
Aug 08, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #744
Fix the "quiet" log level, close #743.
parents
65e1ef85
ac424216
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
12 deletions
+7
-12
CMakeLists.txt
CMakeLists.txt
+0
-1
libcaf_core/caf/make_actor.hpp
libcaf_core/caf/make_actor.hpp
+1
-1
libcaf_core/src/actor_registry.cpp
libcaf_core/src/actor_registry.cpp
+1
-1
libcaf_core/src/logger.cpp
libcaf_core/src/logger.cpp
+4
-8
libcaf_core/test/logger.cpp
libcaf_core/test/logger.cpp
+1
-1
No files found.
CMakeLists.txt
View file @
eabbc579
...
@@ -380,7 +380,6 @@ macro(to_int_value name)
...
@@ -380,7 +380,6 @@ macro(to_int_value name)
endif
()
endif
()
endmacro
()
endmacro
()
to_int_value
(
CAF_LOG_LEVEL
)
to_int_value
(
CAF_NO_EXCEPTIONS
)
to_int_value
(
CAF_NO_EXCEPTIONS
)
to_int_value
(
CAF_NO_MEM_MANAGEMENT
)
to_int_value
(
CAF_NO_MEM_MANAGEMENT
)
to_int_value
(
CAF_ENABLE_RUNTIME_CHECKS
)
to_int_value
(
CAF_ENABLE_RUNTIME_CHECKS
)
...
...
libcaf_core/caf/make_actor.hpp
View file @
eabbc579
...
@@ -32,7 +32,7 @@ namespace caf {
...
@@ -32,7 +32,7 @@ namespace caf {
template
<
class
T
,
class
R
=
infer_handle_from_class_t
<
T
>,
class
...
Ts
>
template
<
class
T
,
class
R
=
infer_handle_from_class_t
<
T
>,
class
...
Ts
>
R
make_actor
(
actor_id
aid
,
node_id
nid
,
actor_system
*
sys
,
Ts
&&
...
xs
)
{
R
make_actor
(
actor_id
aid
,
node_id
nid
,
actor_system
*
sys
,
Ts
&&
...
xs
)
{
#if
defined(CAF_LOG_LEVEL) &&
CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG
#if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG
actor_storage
<
T
>*
ptr
=
nullptr
;
actor_storage
<
T
>*
ptr
=
nullptr
;
if
(
logger
::
current_logger
()
->
accepts
(
CAF_LOG_LEVEL_DEBUG
,
if
(
logger
::
current_logger
()
->
accepts
(
CAF_LOG_LEVEL_DEBUG
,
CAF_LOG_FLOW_COMPONENT
))
{
CAF_LOG_FLOW_COMPONENT
))
{
...
...
libcaf_core/src/actor_registry.cpp
View file @
eabbc579
...
@@ -86,7 +86,7 @@ void actor_registry::erase(actor_id key) {
...
@@ -86,7 +86,7 @@ void actor_registry::erase(actor_id key) {
}
}
void
actor_registry
::
inc_running
()
{
void
actor_registry
::
inc_running
()
{
# if
defined(CAF_LOG_LEVEL) &&
CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG
# if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG
auto
value
=
++
running_
;
auto
value
=
++
running_
;
CAF_LOG_DEBUG
(
CAF_ARG
(
value
));
CAF_LOG_DEBUG
(
CAF_ARG
(
value
));
# else
# else
...
...
libcaf_core/src/logger.cpp
View file @
eabbc579
...
@@ -233,11 +233,7 @@ logger::~logger() {
...
@@ -233,11 +233,7 @@ logger::~logger() {
logger
::
logger
(
actor_system
&
sys
)
logger
::
logger
(
actor_system
&
sys
)
:
system_
(
sys
),
:
system_
(
sys
),
#ifdef CAF_LOG_LEVEL
level_
(
CAF_LOG_LEVEL
),
level_
(
CAF_LOG_LEVEL
),
#else
level_
(
0
),
#endif
flags_
(
0
),
flags_
(
0
),
queue_
(
policy
{})
{
queue_
(
policy
{})
{
// nop
// nop
...
@@ -245,7 +241,7 @@ logger::logger(actor_system& sys)
...
@@ -245,7 +241,7 @@ logger::logger(actor_system& sys)
void
logger
::
init
(
actor_system_config
&
cfg
)
{
void
logger
::
init
(
actor_system_config
&
cfg
)
{
CAF_IGNORE_UNUSED
(
cfg
);
CAF_IGNORE_UNUSED
(
cfg
);
#if
defined(CAF_LOG_LEVEL)
#if
CAF_LOG_LEVEL >= 0
namespace
lg
=
defaults
::
logger
;
namespace
lg
=
defaults
::
logger
;
component_filter
=
get_or
(
cfg
,
"logger.component-filter"
,
component_filter
=
get_or
(
cfg
,
"logger.component-filter"
,
lg
::
component_filter
);
lg
::
component_filter
);
...
@@ -434,7 +430,7 @@ const char* logger::skip_path(const char* path) {
...
@@ -434,7 +430,7 @@ const char* logger::skip_path(const char* path) {
}
}
void
logger
::
run
()
{
void
logger
::
run
()
{
#if
defined(CAF_LOG_LEVEL)
#if
CAF_LOG_LEVEL >= 0
log_first_line
();
log_first_line
();
// receive log entries from other threads and actors
// receive log entries from other threads and actors
bool
stop
=
false
;
bool
stop
=
false
;
...
@@ -523,7 +519,7 @@ void logger::log_last_line() {
...
@@ -523,7 +519,7 @@ void logger::log_last_line() {
}
}
void
logger
::
start
()
{
void
logger
::
start
()
{
#if
defined(CAF_LOG_LEVEL)
#if
CAF_LOG_LEVEL >= 0
parent_thread_
=
std
::
this_thread
::
get_id
();
parent_thread_
=
std
::
this_thread
::
get_id
();
if
(
level_
==
CAF_LOG_LEVEL_QUIET
)
if
(
level_
==
CAF_LOG_LEVEL_QUIET
)
return
;
return
;
...
@@ -573,7 +569,7 @@ void logger::start() {
...
@@ -573,7 +569,7 @@ void logger::start() {
}
}
void
logger
::
stop
()
{
void
logger
::
stop
()
{
#if
defined(CAF_LOG_LEVEL)
#if
CAF_LOG_LEVEL >= 0
if
(
has
(
inline_output_flag
))
{
if
(
has
(
inline_output_flag
))
{
log_last_line
();
log_last_line
();
return
;
return
;
...
...
libcaf_core/test/logger.cpp
View file @
eabbc579
...
@@ -88,7 +88,7 @@ CAF_TEST(parse_default_format_strings) {
...
@@ -88,7 +88,7 @@ CAF_TEST(parse_default_format_strings) {
add
(
logger
::
message_field
);
add
(
logger
::
message_field
);
add
(
logger
::
newline_field
);
add
(
logger
::
newline_field
);
CAF_CHECK_EQUAL
(
logger
::
parse_format
(
file_format
),
lf
);
CAF_CHECK_EQUAL
(
logger
::
parse_format
(
file_format
),
lf
);
#if
def CAF_LOG_LEVEL
#if
CAF_LOG_LEVEL >= 0
// Not parsed when compiling without logging enabled.
// Not parsed when compiling without logging enabled.
CAF_CHECK_EQUAL
(
sys
.
logger
().
file_format
(),
lf
);
CAF_CHECK_EQUAL
(
sys
.
logger
().
file_format
(),
lf
);
#endif
#endif
...
...
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