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
c848d5f6
Commit
c848d5f6
authored
Nov 20, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently use unsigned for log level & line nr
parent
573d8b06
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
19 deletions
+20
-19
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+14
-14
libcaf_core/src/logger.cpp
libcaf_core/src/logger.cpp
+5
-4
libcaf_core/test/logger.cpp
libcaf_core/test/logger.cpp
+1
-1
No files found.
libcaf_core/caf/logger.hpp
View file @
c848d5f6
...
@@ -112,14 +112,17 @@ public:
...
@@ -112,14 +112,17 @@ public:
event
&
operator
=
(
const
event
&
)
=
default
;
event
&
operator
=
(
const
event
&
)
=
default
;
event
(
int
lvl
,
string_view
cat
,
string_view
full_fun
,
string_view
fun
,
event
(
unsigned
lvl
,
unsigned
line
,
string_view
cat
,
string_view
full_
fun
,
string_view
f
n
,
int
line
,
std
::
string
msg
,
std
::
thread
::
id
t
,
string_view
f
un
,
string_view
fn
,
std
::
string
msg
,
std
::
thread
::
id
t
,
actor_id
a
,
timestamp
ts
);
actor_id
a
,
timestamp
ts
);
// -- member variables -----------------------------------------------------
// -- member variables -----------------------------------------------------
/// Level/priority of the event.
/// Level/priority of the event.
int
level
;
unsigned
level
;
/// Current line in the file.
unsigned
line_number
;
/// Name of the category (component) logging the event.
/// Name of the category (component) logging the event.
string_view
category_name
;
string_view
category_name
;
...
@@ -133,9 +136,6 @@ public:
...
@@ -133,9 +136,6 @@ public:
/// Name of the current file.
/// Name of the current file.
string_view
file_name
;
string_view
file_name
;
/// Current line in the file.
int
line_number
;
/// User-provided message.
/// User-provided message.
std
::
string
message
;
std
::
string
message
;
...
@@ -239,16 +239,16 @@ public:
...
@@ -239,16 +239,16 @@ public:
return
console_format_
;
return
console_format_
;
}
}
int
verbosity
()
const
noexcept
{
unsigned
verbosity
()
const
noexcept
{
return
static_cast
<
int
>
(
cfg_
.
verbosity
)
;
return
cfg_
.
verbosity
;
}
}
int
file_verbosity
()
const
noexcept
{
unsigned
file_verbosity
()
const
noexcept
{
return
static_cast
<
int
>
(
cfg_
.
file_verbosity
)
;
return
cfg_
.
file_verbosity
;
}
}
int
console_verbosity
()
const
noexcept
{
unsigned
console_verbosity
()
const
noexcept
{
return
static_cast
<
int
>
(
cfg_
.
console_verbosity
)
;
return
cfg_
.
console_verbosity
;
}
}
// -- static utility functions -----------------------------------------------
// -- static utility functions -----------------------------------------------
...
@@ -433,8 +433,8 @@ bool operator==(const logger::field& x, const logger::field& y);
...
@@ -433,8 +433,8 @@ bool operator==(const logger::field& x, const logger::field& y);
#define CAF_LOG_MAKE_EVENT(aid, component, loglvl, message) \
#define CAF_LOG_MAKE_EVENT(aid, component, loglvl, message) \
::caf::logger::event { \
::caf::logger::event { \
loglvl,
component, CAF_PRETTY_FUN, __func__,
\
loglvl,
__LINE__, component, CAF_PRETTY_FUN, __func__,
\
caf::logger::skip_path(__FILE__),
__LINE__,
\
caf::logger::skip_path(__FILE__),
\
(::caf::logger::line_builder{} << message).get(), \
(::caf::logger::line_builder{} << message).get(), \
::std::this_thread::get_id(), aid, ::caf::make_timestamp() \
::std::this_thread::get_id(), aid, ::caf::make_timestamp() \
}
}
...
...
libcaf_core/src/logger.cpp
View file @
c848d5f6
...
@@ -254,15 +254,16 @@ logger::config::config()
...
@@ -254,15 +254,16 @@ logger::config::config()
// nop
// nop
}
}
logger
::
event
::
event
(
int
lvl
,
string_view
cat
,
string_view
full_fun
,
logger
::
event
::
event
(
unsigned
lvl
,
unsigned
line
,
string_view
cat
,
string_view
fun
,
string_view
fn
,
int
line
,
std
::
string
msg
,
string_view
full_fun
,
string_view
fun
,
string_view
fn
,
std
::
thread
::
id
t
,
actor_id
a
,
timestamp
ts
)
std
::
string
msg
,
std
::
thread
::
id
t
,
actor_id
a
,
timestamp
ts
)
:
level
(
lvl
),
:
level
(
lvl
),
line_number
(
line
),
category_name
(
cat
),
category_name
(
cat
),
pretty_fun
(
full_fun
),
pretty_fun
(
full_fun
),
simple_fun
(
fun
),
simple_fun
(
fun
),
file_name
(
fn
),
file_name
(
fn
),
line_number
(
line
),
message
(
std
::
move
(
msg
)),
message
(
std
::
move
(
msg
)),
tid
(
std
::
move
(
t
)),
tid
(
std
::
move
(
t
)),
aid
(
a
),
aid
(
a
),
...
...
libcaf_core/test/logger.cpp
View file @
c848d5f6
...
@@ -179,11 +179,11 @@ CAF_TEST(rendering) {
...
@@ -179,11 +179,11 @@ CAF_TEST(rendering) {
// Rendering of events.
// Rendering of events.
logger
::
event
e
{
logger
::
event
e
{
CAF_LOG_LEVEL_WARNING
,
CAF_LOG_LEVEL_WARNING
,
42
,
"unit.test"
,
"unit.test"
,
"void ns::foo::bar()"
,
"void ns::foo::bar()"
,
"bar"
,
"bar"
,
"foo.cpp"
,
"foo.cpp"
,
42
,
"hello world"
,
"hello world"
,
std
::
this_thread
::
get_id
(),
std
::
this_thread
::
get_id
(),
0
,
0
,
...
...
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