libadc-cxx 1.0.0
Structured logging for scientific computing
Loading...
Searching...
No Matches
Public Member Functions | List of all members
adc::libadiak_json_plugin Class Reference

Terminal output publisher_api implementation. This plugin sends messages to libadiak synchronously. Multiple independent instances of this plugin may be used simultaneously, but message integrity depends on the behavior of libadiak. More...

Inheritance diagram for adc::libadiak_json_plugin:
Inheritance graph
[legend]
Collaboration diagram for adc::libadiak_json_plugin:
Collaboration graph
[legend]

Public Member Functions

 libadiak_json_plugin ()
 
int publish (std::shared_ptr< builder_api > b)
 Publish the content of the builder.
 
int config (const std::map< std::string, std::string > &m)
 Configure the plugin with the options given.
 
int config (const std::map< std::string, std::string > &m, std::string_view env_prefix)
 Configure the plugin with the options given and the corresponding environment variables.
 
const std::map< const std::string, const std::string > & get_option_defaults ()
 Look up the settable options and their defaults.
 
int initialize ()
 Ready the plugin to publish following the configuration options set or defaulted.
 
void finalize ()
 Stop publishing and release any resources held for managing publication.
 
void pause ()
 Pause publishing until a call to resume. Duplicate calls are allowed.
 
void resume ()
 Resume publishing Duplicate calls are allowed.
 
std::string_view name () const
 
std::string_view version () const
 
 ~libadiak_json_plugin ()
 

Detailed Description

Terminal output publisher_api implementation. This plugin sends messages to libadiak synchronously. Multiple independent instances of this plugin may be used simultaneously, but message integrity depends on the behavior of libadiak.

Definition at line 15 of file libadiak_json.ipp.

Constructor & Destructor Documentation

◆ libadiak_json_plugin()

adc::libadiak_json_plugin::libadiak_json_plugin ( )
inline

Definition at line 28 of file libadiak_json.ipp.

◆ ~libadiak_json_plugin()

adc::libadiak_json_plugin::~libadiak_json_plugin ( )
inline

Definition at line 77 of file libadiak_json.ipp.

Member Function Documentation

◆ publish()

int adc::libadiak_json_plugin::publish ( std::shared_ptr< builder_api b)
inlinevirtual

Publish the content of the builder.

Parameters
bconverted to a single json object and published

Implements adc::publisher_api.

Definition at line 32 of file libadiak_json.ipp.

◆ config() [1/2]

int adc::libadiak_json_plugin::config ( const std::map< std::string, std::string > &  m)
inlinevirtual

Configure the plugin with the options given.

Parameters
ma map with keys documented in the plugin-specific header.

For plugin QQQ, Environment variables ADC_QQQ_PLUGIN_* will override the source code default for any key not defined in m. Here QQQ is the uppercase version of the plugin name.

Implements adc::publisher_api.

Definition at line 42 of file libadiak_json.ipp.

◆ config() [2/2]

int adc::libadiak_json_plugin::config ( const std::map< std::string, std::string > &  m,
std::string_view  env_prefix 
)
inlinevirtual

Configure the plugin with the options given and the corresponding environment variables.

Parameters
ma map with keys documented in the plugin-specific header.
env_prefixis prepended to the expected keys for the plugin and values found with getenv that match are used, overriding elements of m. Typically, env_prefix will be PPP_ADC_QQQ_PLUGIN_ if application PPP wants to override the defaults of plugin QQQ. Here QQQ is the uppercase version of the plugin name.

Implements adc::publisher_api.

Definition at line 46 of file libadiak_json.ipp.

◆ get_option_defaults()

const std::map< const std::string, const std::string > & adc::libadiak_json_plugin::get_option_defaults ( )
inlinevirtual

Look up the settable options and their defaults.

Some plugins without options will return an empty map.

Implements adc::publisher_api.

Definition at line 50 of file libadiak_json.ipp.

◆ initialize()

int adc::libadiak_json_plugin::initialize ( )
inlinevirtual

Ready the plugin to publish following the configuration options set or defaulted.

Implements adc::publisher_api.

Definition at line 54 of file libadiak_json.ipp.

◆ finalize()

void adc::libadiak_json_plugin::finalize ( )
inlinevirtual

Stop publishing and release any resources held for managing publication.

Implements adc::publisher_api.

Definition at line 58 of file libadiak_json.ipp.

◆ pause()

void adc::libadiak_json_plugin::pause ( )
inlinevirtual

Pause publishing until a call to resume. Duplicate calls are allowed.

Implements adc::publisher_api.

Definition at line 61 of file libadiak_json.ipp.

◆ resume()

void adc::libadiak_json_plugin::resume ( )
inlinevirtual

Resume publishing Duplicate calls are allowed.

Implements adc::publisher_api.

Definition at line 65 of file libadiak_json.ipp.

◆ name()

std::string_view adc::libadiak_json_plugin::name ( ) const
inlinevirtual
Returns
the name of the plugin

Implements adc::publisher_api.

Definition at line 69 of file libadiak_json.ipp.

◆ version()

std::string_view adc::libadiak_json_plugin::version ( ) const
inlinevirtual
Returns
the version of the plugin (should follow semantic versioning practices)

Implements adc::publisher_api.

Definition at line 73 of file libadiak_json.ipp.


The documentation for this class was generated from the following file: