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
1056e215
Commit
1056e215
authored
Mar 17, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip path of source files in logs
parent
50abe47a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+5
-2
libcaf_core/src/logger.cpp
libcaf_core/src/logger.cpp
+5
-0
No files found.
libcaf_core/caf/logger.hpp
View file @
1056e215
...
@@ -256,6 +256,9 @@ public:
...
@@ -256,6 +256,9 @@ public:
/// @warning The returned vector can have pointers into `format_str`.
/// @warning The returned vector can have pointers into `format_str`.
static
line_format
parse_format
(
const
char
*
format_str
);
static
line_format
parse_format
(
const
char
*
format_str
);
/// Skips path in `filename`.
static
const
char
*
skip_path
(
const
char
*
filename
);
/// Returns a string representation of the joined groups of `x` if `x` is an
/// Returns a string representation of the joined groups of `x` if `x` is an
/// actor with the `subscriber` mixin.
/// actor with the `subscriber` mixin.
template
<
class
T
>
template
<
class
T
>
...
@@ -371,8 +374,8 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
...
@@ -371,8 +374,8 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
&& CAF_UNIFYN(caf_logger)->accepts(loglvl, component)) \
&& CAF_UNIFYN(caf_logger)->accepts(loglvl, component)) \
CAF_UNIFYN(caf_logger) \
CAF_UNIFYN(caf_logger) \
->log(new ::caf::logger::event{ \
->log(new ::caf::logger::event{ \
loglvl, component, CAF_PRETTY_FUN,
__FILE__, __LINE__,
\
loglvl, component, CAF_PRETTY_FUN,
caf::logger::skip_path(__FILE__),
\
(::caf::logger::line_builder{} << message).get(),
\
__LINE__, (::caf::logger::line_builder{} << message).get(),
\
::std::this_thread::get_id(), \
::std::this_thread::get_id(), \
CAF_UNIFYN(caf_logger)->thread_local_aid(), \
CAF_UNIFYN(caf_logger)->thread_local_aid(), \
::caf::make_timestamp()}); \
::caf::make_timestamp()}); \
...
...
libcaf_core/src/logger.cpp
View file @
1056e215
...
@@ -399,6 +399,11 @@ logger::line_format logger::parse_format(const char* format_str) {
...
@@ -399,6 +399,11 @@ logger::line_format logger::parse_format(const char* format_str) {
return
res
;
return
res
;
}
}
const
char
*
logger
::
skip_path
(
const
char
*
path
)
{
auto
ptr
=
strrchr
(
path
,
'/'
);
return
ptr
==
nullptr
?
path
:
(
ptr
+
1
);
}
void
logger
::
run
()
{
void
logger
::
run
()
{
#if defined(CAF_LOG_LEVEL)
#if defined(CAF_LOG_LEVEL)
log_first_line
();
log_first_line
();
...
...
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