Skip to content

Commit

Permalink
Destroy explicitly created logging objects in WASM beekeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz-Trela authored and vogel76 committed Oct 28, 2023
1 parent f60fa18 commit 7def099
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion programs/beekeeper/beekeeper_wasm/beekeeper_wasm_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ beekeeper_wasm_app::beekeeper_wasm_app()

beekeeper_wasm_app::~beekeeper_wasm_app()
{
if( enable_logs )
fc::configure_logging( fc::logging_config() );//destroy explicitly created appenders
}

void beekeeper_wasm_app::set_program_options()
Expand Down Expand Up @@ -52,7 +54,9 @@ void beekeeper_wasm_app::setup_logger( const boost::program_options::variables_m
{
FC_ASSERT( args.count("enable-logs") );

if( args.at( "enable-logs" ).as<bool>() )
enable_logs = args.at( "enable-logs" ).as<bool>();

if( enable_logs )
fc::configure_logging( fc::logging_config::default_config( "stdout" ) );
else
fc::configure_logging( fc::logging_config() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class beekeeper_wasm_app: public beekeeper_app_init
{
private:

bool enable_logs = true;

boost::program_options::variables_map args;

protected:
Expand Down

0 comments on commit 7def099

Please sign in to comment.