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
e96c0df0
Commit
e96c0df0
authored
Jun 29, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve logging of SE-0001 events
parent
a32890db
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
7 deletions
+32
-7
libcaf_core/caf/abstract_channel.hpp
libcaf_core/caf/abstract_channel.hpp
+2
-0
libcaf_core/caf/actor_system.hpp
libcaf_core/caf/actor_system.hpp
+2
-0
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+12
-5
libcaf_core/caf/make_actor.hpp
libcaf_core/caf/make_actor.hpp
+15
-1
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+1
-1
No files found.
libcaf_core/caf/abstract_channel.hpp
View file @
e96c0df0
...
...
@@ -51,6 +51,8 @@ public:
static
constexpr
int
is_actor_decorator_mask
=
0x0C000000
;
static
constexpr
int
is_hidden_flag
=
0x10000000
;
inline
bool
is_abstract_actor
()
const
{
return
static_cast
<
bool
>
(
flags
()
&
is_abstract_actor_flag
);
}
...
...
libcaf_core/caf/actor_system.hpp
View file @
e96c0df0
...
...
@@ -532,6 +532,8 @@ private:
:
0
;
if
(
has_detach_flag
(
Os
)
||
std
::
is_base_of
<
blocking_actor
,
C
>::
value
)
cfg
.
flags
|=
abstract_actor
::
is_detached_flag
;
if
(
has_hide_flag
(
Os
))
cfg
.
flags
|=
abstract_actor
::
is_hidden_flag
;
if
(
!
cfg
.
host
)
cfg
.
host
=
dummy_execution_unit
();
CAF_SET_LOGGER_SYS
(
this
);
...
...
libcaf_core/caf/logger.hpp
View file @
e96c0df0
...
...
@@ -39,6 +39,7 @@
#include "caf/detail/scope_guard.hpp"
#include "caf/detail/shared_spinlock.hpp"
#include "caf/detail/pretty_type_name.hpp"
#include "caf/detail/single_reader_queue.hpp"
/*
...
...
@@ -423,10 +424,13 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
/// crucial for understanding happens-before relations. See RFC SE-0001.
#define CAF_LOG_FLOW_COMPONENT "caf.flow"
#define CAF_LOG_SPAWN_EVENT(
aid, aargs)
\
#define CAF_LOG_SPAWN_EVENT(
ref, ctor_data)
\
CAF_LOG_IMPL(CAF_LOG_FLOW_COMPONENT, CAF_LOG_LEVEL_DEBUG, \
"SPAWN ; ID =" << aid \
<< "; ARGS =" << deep_to_string(aargs).c_str())
"SPAWN ; ID =" << ref.id() << "; NAME =" << ref.name() \
<< "; TYPE =" \
<< ::caf::detail::pretty_type_name(typeid(ref)) \
<< "; ARGS =" << ctor_data.c_str() \
<< "; NODE =" << ref.node())
#define CAF_LOG_INIT_EVENT(aName, aHide) \
CAF_LOG_IMPL(CAF_LOG_FLOW_COMPONENT, CAF_LOG_LEVEL_DEBUG, \
...
...
@@ -462,8 +466,11 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
#define CAF_LOG_FINALIZE_EVENT() \
CAF_LOG_IMPL(CAF_LOG_FLOW_COMPONENT, CAF_LOG_LEVEL_DEBUG, "FINALIZE")
#define CAF_LOG_TERMINATE_EVENT(
rsn)
\
#define CAF_LOG_TERMINATE_EVENT(
thisptr, rsn)
\
CAF_LOG_IMPL(CAF_LOG_FLOW_COMPONENT, CAF_LOG_LEVEL_DEBUG, \
"TERMINATE ; REASON =" << deep_to_string(rsn).c_str())
"TERMINATE ; ID =" \
<< thisptr->id() << "; NAME =" << thisptr->name() \
<< "; REASON =" << deep_to_string(rsn).c_str() \
<< "; NODE =" << thisptr->node())
#endif // CAF_LOGGER_HPP
libcaf_core/caf/make_actor.hpp
View file @
e96c0df0
...
...
@@ -34,9 +34,23 @@ namespace caf {
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
)
{
CAF_LOG_SPAWN_EVENT
(
aid
,
std
::
forward_as_tuple
(
xs
...));
#if defined(CAF_LOG_LEVEL) && CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG
actor_storage
<
T
>*
ptr
=
nullptr
;
if
(
logger
::
current_logger
()
->
accepts
(
CAF_LOG_LEVEL_DEBUG
,
CAF_LOG_FLOW_COMPONENT
))
{
std
::
string
args
;
args
=
deep_to_string
(
std
::
forward_as_tuple
(
xs
...));
ptr
=
new
actor_storage
<
T
>
(
aid
,
std
::
move
(
nid
),
sys
,
std
::
forward
<
Ts
>
(
xs
)...);
CAF_LOG_SPAWN_EVENT
(
ptr
->
data
,
args
);
}
else
{
ptr
=
new
actor_storage
<
T
>
(
aid
,
std
::
move
(
nid
),
sys
,
std
::
forward
<
Ts
>
(
xs
)...);
}
#else
auto
ptr
=
new
actor_storage
<
T
>
(
aid
,
std
::
move
(
nid
),
sys
,
std
::
forward
<
Ts
>
(
xs
)...);
#endif
return
{
&
(
ptr
->
ctrl
),
false
};
}
...
...
libcaf_core/src/local_actor.cpp
View file @
e96c0df0
...
...
@@ -186,7 +186,7 @@ bool local_actor::cleanup(error&& fail_state, execution_unit* host) {
// tell registry we're done
unregister_from_system
();
monitorable_actor
::
cleanup
(
std
::
move
(
fail_state
),
host
);
CAF_LOG_TERMINATE_EVENT
(
fail_state
);
CAF_LOG_TERMINATE_EVENT
(
this
,
fail_state
);
return
true
;
}
...
...
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