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
4a8b213b
Commit
4a8b213b
authored
Jun 29, 2023
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the logger.inline-output parameter
parent
3d18029e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
8 deletions
+9
-8
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+6
-0
libcaf_core/src/actor_system.cpp
libcaf_core/src/actor_system.cpp
+3
-0
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+0
-3
libcaf_core/src/logger.cpp
libcaf_core/src/logger.cpp
+0
-3
libcaf_core/test/settings.cpp
libcaf_core/test/settings.cpp
+0
-1
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+0
-1
No files found.
libcaf_core/caf/logger.hpp
View file @
4a8b213b
...
@@ -273,6 +273,12 @@ private:
...
@@ -273,6 +273,12 @@ private:
logger
(
actor_system
&
sys
);
logger
(
actor_system
&
sys
);
// -- called by the actor_system when running with a test coordinator --------
void
inline_output
(
bool
value
)
noexcept
{
cfg_
.
inline_output
=
value
;
}
// -- initialization ---------------------------------------------------------
// -- initialization ---------------------------------------------------------
void
init
(
actor_system_config
&
cfg
);
void
init
(
actor_system_config
&
cfg
);
...
...
libcaf_core/src/actor_system.cpp
View file @
4a8b213b
...
@@ -351,6 +351,9 @@ actor_system::actor_system(actor_system_config& cfg)
...
@@ -351,6 +351,9 @@ actor_system::actor_system(actor_system_config& cfg)
// Initialize state for each module and give each module the opportunity to
// Initialize state for each module and give each module the opportunity to
// adapt the system configuration.
// adapt the system configuration.
logger_
->
init
(
cfg
);
logger_
->
init
(
cfg
);
// When running with the test coordinator, generate logs in the same thread.
if
(
!
scheduler
().
detaches_utility_actors
())
logger_
->
inline_output
(
true
);
CAF_SET_LOGGER_SYS
(
this
);
CAF_SET_LOGGER_SYS
(
this
);
for
(
auto
&
mod
:
modules_
)
for
(
auto
&
mod
:
modules_
)
if
(
mod
)
if
(
mod
)
...
...
libcaf_core/src/actor_system_config.cpp
View file @
4a8b213b
...
@@ -71,8 +71,6 @@ actor_system_config::actor_system_config()
...
@@ -71,8 +71,6 @@ actor_system_config::actor_system_config()
"frequency of relaxed steal attempts"
)
"frequency of relaxed steal attempts"
)
.
add
<
timespan
>
(
"relaxed-sleep-duration"
,
.
add
<
timespan
>
(
"relaxed-sleep-duration"
,
"sleep duration between relaxed steal attempts"
);
"sleep duration between relaxed steal attempts"
);
opt_group
{
custom_options_
,
"caf.logger"
}
//
.
add
<
bool
>
(
"inline-output"
,
"disable logger thread (for testing only!)"
);
opt_group
{
custom_options_
,
"caf.logger.file"
}
opt_group
{
custom_options_
,
"caf.logger.file"
}
.
add
<
string
>
(
"path"
,
"filesystem path for the log file"
)
.
add
<
string
>
(
"path"
,
"filesystem path for the log file"
)
.
add
<
string
>
(
"format"
,
"format for individual log file entries"
)
.
add
<
string
>
(
"format"
,
"format for individual log file entries"
)
...
@@ -121,7 +119,6 @@ settings actor_system_config::dump_content() const {
...
@@ -121,7 +119,6 @@ settings actor_system_config::dump_content() const {
defaults
::
work_stealing
::
relaxed_sleep_duration
);
defaults
::
work_stealing
::
relaxed_sleep_duration
);
// -- logger parameters
// -- logger parameters
auto
&
logger_group
=
caf_group
[
"logger"
].
as_dictionary
();
auto
&
logger_group
=
caf_group
[
"logger"
].
as_dictionary
();
// Note: omit "inline-output" option since it should only be used for testing.
auto
&
file_group
=
logger_group
[
"file"
].
as_dictionary
();
auto
&
file_group
=
logger_group
[
"file"
].
as_dictionary
();
put_missing
(
file_group
,
"path"
,
defaults
::
logger
::
file
::
path
);
put_missing
(
file_group
,
"path"
,
defaults
::
logger
::
file
::
path
);
put_missing
(
file_group
,
"format"
,
defaults
::
logger
::
file
::
format
);
put_missing
(
file_group
,
"format"
,
defaults
::
logger
::
file
::
format
);
...
...
libcaf_core/src/logger.cpp
View file @
4a8b213b
...
@@ -308,9 +308,6 @@ void logger::init(actor_system_config& cfg) {
...
@@ -308,9 +308,6 @@ void logger::init(actor_system_config& cfg) {
=
parse_format
(
get_or
(
cfg
,
"caf.logger.file.format"
,
lg
::
file
::
format
));
=
parse_format
(
get_or
(
cfg
,
"caf.logger.file.format"
,
lg
::
file
::
format
));
console_format_
=
parse_format
(
console_format_
=
parse_format
(
get_or
(
cfg
,
"caf.logger.console.format"
,
lg
::
console
::
format
));
get_or
(
cfg
,
"caf.logger.console.format"
,
lg
::
console
::
format
));
// Set flags.
if
(
get_or
(
cfg
,
"caf.logger.inline-output"
,
false
))
cfg_
.
inline_output
=
true
;
// If not set to `false`, CAF enables colored output when writing to TTYs.
// If not set to `false`, CAF enables colored output when writing to TTYs.
cfg_
.
console_coloring
=
get_or
(
cfg
,
"caf.logger.console.colored"
,
true
);
cfg_
.
console_coloring
=
get_or
(
cfg
,
"caf.logger.console.colored"
,
true
);
}
}
...
...
libcaf_core/test/settings.cpp
View file @
4a8b213b
...
@@ -32,7 +32,6 @@ struct fixture {
...
@@ -32,7 +32,6 @@ struct fixture {
logger
[
"console-format"
]
=
"%m"
;
logger
[
"console-format"
]
=
"%m"
;
logger
[
"console-verbosity"
]
=
"trace"
;
logger
[
"console-verbosity"
]
=
"trace"
;
logger
[
"file-format"
]
=
"%r %c %p %a %t %C %M %F:%L %m%n"
;
logger
[
"file-format"
]
=
"%r %c %p %a %t %C %M %F:%L %m%n"
;
logger
[
"inline-output"
]
=
false
;
auto
&
middleman
=
x
[
"middleman"
].
as_dictionary
();
auto
&
middleman
=
x
[
"middleman"
].
as_dictionary
();
middleman
[
"app-identifiers"
]
=
make_config_value_list
(
"generic-caf-app"
);
middleman
[
"app-identifiers"
]
=
make_config_value_list
(
"generic-caf-app"
);
middleman
[
"enable-automatic-connections"
]
=
false
;
middleman
[
"enable-automatic-connections"
]
=
false
;
...
...
libcaf_test/caf/test/dsl.hpp
View file @
4a8b213b
...
@@ -700,7 +700,6 @@ public:
...
@@ -700,7 +700,6 @@ public:
caf
::
test
::
engine
::
argv
()))
caf
::
test
::
engine
::
argv
()))
CAF_FAIL
(
"failed to parse config: "
<<
to_string
(
err
));
CAF_FAIL
(
"failed to parse config: "
<<
to_string
(
err
));
cfg
.
set
(
"caf.scheduler.policy"
,
"testing"
);
cfg
.
set
(
"caf.scheduler.policy"
,
"testing"
);
cfg
.
set
(
"caf.logger.inline-output"
,
true
);
if
(
cfg
.
custom_options
().
has_category
(
"caf.middleman"
))
{
if
(
cfg
.
custom_options
().
has_category
(
"caf.middleman"
))
{
cfg
.
set
(
"caf.middleman.network-backend"
,
"testing"
);
cfg
.
set
(
"caf.middleman.network-backend"
,
"testing"
);
cfg
.
set
(
"caf.middleman.manual-multiplexing"
,
true
);
cfg
.
set
(
"caf.middleman.manual-multiplexing"
,
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