Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion console/executor_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ const std::unordered_map<uint8_t, std::string> executor::fired_

// Events.
// ----------------------------------------------------------------------------
// Eventing uses underling std::ostream. It is possible that these may throw
// upon certain unexpected failures, such as a disconnected device. Presently
// the writes are not wrapped in a try block (performance) but this can be
// appplied centrally below if desired.

// TODO: throws, handle failure.
system::ofstream executor::create_event_sink() const
{
// Standard file name, within the [node].path directory.
Expand Down
7 changes: 5 additions & 2 deletions console/executor_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ const std::unordered_map<uint8_t, bool> executor::defined_

// Logging.
// ----------------------------------------------------------------------------
// Logging uses underling std::ostream. It is possible that these may throw
// upon certain unexpected failures, such as a disconnected device. Presently
// the writes are not wrapped in a try block (performance) but this can be
// appplied centrally below if desired.

// TODO: verify construction failure handled.
database::file::stream::out::rotator executor::create_log_sink() const
{
return
return
{
// Standard file names, within the [node].path directory.
metadata_.configured.log.log_file1(),
Expand Down
5 changes: 4 additions & 1 deletion console/executor_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void executor::stopper(const std::string& message)
capture_.stop();

// Stop log, causing final message to be buffered by handler.
log_.stop(message,levels::application);
log_.stop(message, levels::application);

// Suspend process termination until final message is buffered.
stopped_.get_future().wait();
Expand Down Expand Up @@ -106,10 +106,13 @@ bool executor::do_run()
auto events = create_event_sink();
if (!log || !events)
{
// Stop ensures console output.
log_.stop();
logger(BS_LOG_INITIALIZE_FAILURE);
return false;
}

// These all use std iostreams (exception risk).
subscribe_log(log);
subscribe_events(events);
subscribe_capture();
Expand Down
2 changes: 1 addition & 1 deletion console/localize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
"compiled:%1% enabled:%2%."

#define BS_LOG_INITIALIZE_FAILURE \
"Failed to initialize logging."
"Failed to initialize logging, check configured path."
#define BS_USING_CONFIG_FILE \
"Using config file: %1%"
#define BS_USING_DEFAULT_CONFIG \
Expand Down
Loading