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
1b4a018e
Commit
1b4a018e
authored
Jun 29, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build with ASAN version of Clang
parent
72c449ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
libcaf_core/src/logger.cpp
libcaf_core/src/logger.cpp
+8
-8
No files found.
libcaf_core/src/logger.cpp
View file @
1b4a018e
...
...
@@ -241,8 +241,9 @@ void logger::init(actor_system_config& cfg) {
void
logger
::
render_fun_prefix
(
std
::
ostream
&
out
,
const
char
*
pretty_fun
)
{
auto
first
=
pretty_fun
;
// set end to beginning of arguments
auto
last
=
std
::
find_if
(
first
,
static_cast
<
const
char
*>
(
nullptr
),
[](
char
x
)
{
return
x
==
'('
||
x
==
'\0'
;
});
const
char
*
last
=
strchr
(
pretty_fun
,
'('
);
if
(
last
==
nullptr
)
return
;
auto
strsize
=
static_cast
<
size_t
>
(
last
-
first
);
auto
jump_to_next_whitespace
=
[
&
]
{
// leave `first` unchanged if no whitespaces is present,
...
...
@@ -274,16 +275,15 @@ void logger::render_fun_prefix(std::ostream& out, const char* pretty_fun) {
void
logger
::
render_fun_name
(
std
::
ostream
&
out
,
const
char
*
pretty_fun
)
{
// Find the end of the function name by looking for the opening parenthesis
// trailing it.
const
char
*
e
=
nullptr
;
// safe, because pretty_fun is null-terminated
auto
i
=
std
::
find_if
(
pretty_fun
,
e
,
[](
char
x
)
{
return
x
==
'('
||
x
==
'\0'
;
});
if
(
*
i
==
'\0'
)
CAF_ASSERT
(
pretty_fun
!=
nullptr
);
const
char
*
e
=
strchr
(
pretty_fun
,
'('
);
if
(
e
==
nullptr
)
return
;
/// Now look for the beginning of the function name.
using
rev_iter
=
std
::
reverse_iterator
<
const
char
*>
;
auto
b
=
std
::
find_if
(
rev_iter
(
i
),
rev_iter
(
pretty_fun
),
auto
b
=
std
::
find_if
(
rev_iter
(
e
),
rev_iter
(
pretty_fun
),
[](
char
x
)
{
return
x
==
':'
||
x
==
' '
;
});
out
.
write
(
b
.
base
(),
i
-
b
.
base
());
out
.
write
(
b
.
base
(),
e
-
b
.
base
());
}
void
logger
::
render_time_diff
(
std
::
ostream
&
out
,
timestamp
t0
,
timestamp
tn
)
{
...
...
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