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
20f3e5f6
Commit
20f3e5f6
authored
Jul 18, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent log level from being set accidently
parent
65f21491
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
caf/detail/logging.hpp
caf/detail/logging.hpp
+0
-1
src/logging.cpp
src/logging.cpp
+7
-1
No files found.
caf/detail/logging.hpp
View file @
20f3e5f6
...
@@ -159,7 +159,6 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
...
@@ -159,7 +159,6 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
#define CAF_PUSH_AID(unused) static_cast<void>(0)
#define CAF_PUSH_AID(unused) static_cast<void>(0)
#define CAF_PUSH_AID_FROM_PTR(unused) static_cast<void>(0)
#define CAF_PUSH_AID_FROM_PTR(unused) static_cast<void>(0)
#define CAF_SET_AID(unused) caf_set_aid_dummy()
#define CAF_SET_AID(unused) caf_set_aid_dummy()
#define CAF_LOG_LEVEL 1
#else
#else
#define CAF_LOG_IMPL(lvlname, classname, funname, message) \
#define CAF_LOG_IMPL(lvlname, classname, funname, message) \
if (strcmp(lvlname, "ERROR") == 0) { \
if (strcmp(lvlname, "ERROR") == 0) { \
...
...
src/logging.cpp
View file @
20f3e5f6
...
@@ -65,6 +65,12 @@ struct log_event {
...
@@ -65,6 +65,12 @@ struct log_event {
};
};
#ifndef CAF_LOG_LEVEL
constexpr
int
global_log_level
=
0
;
#else
constexpr
int
global_log_level
=
CAF_LOG_LEVEL
;
#endif
class
logging_impl
:
public
logging
{
class
logging_impl
:
public
logging
{
public:
public:
...
@@ -74,7 +80,7 @@ class logging_impl : public logging {
...
@@ -74,7 +80,7 @@ class logging_impl : public logging {
"DEBUG"
,
"TRACE"
};
"DEBUG"
,
"TRACE"
};
m_thread
=
std
::
thread
([
this
]
{
(
*
this
)();
});
m_thread
=
std
::
thread
([
this
]
{
(
*
this
)();
});
std
::
string
msg
=
"ENTRY log level = "
;
std
::
string
msg
=
"ENTRY log level = "
;
msg
+=
log_level_lookup_table
[
CAF_LOG_LEVEL
];
msg
+=
log_level_lookup_table
[
global_log_level
];
log
(
"TRACE"
,
"logging"
,
"run"
,
__FILE__
,
__LINE__
,
msg
);
log
(
"TRACE"
,
"logging"
,
"run"
,
__FILE__
,
__LINE__
,
msg
);
}
}
...
...
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