|
libadc-cxx 1.0.0
Structured logging for scientific computing
|
User script publisher plugin. The program specified by environment variable is used to asynchronously deliver published messages. It is invoked in a shell as: ($prog $messagefile > /dev/null 2>&1 || /bin/rm $messagefile) &. More...


Public Member Functions | |
| script_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. | |
| string_view | name () const |
| string_view | version () const |
| ~script_plugin () | |
Static Public Attributes | |
| static const char * | adc_script_plugin_dir_default = "/dev/shm/adc" |
| The default scratch directory for user script messages. This directory must be globally writable and should be fast. Overridden with env("ADC_SCRIPT_PLUGIN_DIRECTORY"). | |
| static const char * | adc_script_plugin_prog_default = ":" |
| The default path to a user script or program. This program should be user accessible. Overridden with env("ADC_SCRIPT_PLUGIN_PROG"). The default : is a non-operation. | |
| static const char * | adc_script_plugin_debug_default = "0" |
| ADC script plugin enable debug messages; (default "0": none) "2" provides message send debugging "1" provides lighter debugging Overridden with env("ADC_SCRIPT_PLUGIN_DEBUG"). | |
User script publisher plugin. The program specified by environment variable is used to asynchronously deliver published messages. It is invoked in a shell as: ($prog $messagefile > /dev/null 2>&1 || /bin/rm $messagefile) &.
Definition at line 22 of file script.ipp.
|
inline |
Definition at line 135 of file script.ipp.
|
inline |
Definition at line 243 of file script.ipp.
|
inlinevirtual |
Publish the content of the builder.
| b | converted to a single json object and published |
Implements adc::publisher_api.
Definition at line 137 of file script.ipp.
|
inlinevirtual |
Configure the plugin with the options given.
| m | a 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 172 of file script.ipp.
|
inlinevirtual |
Configure the plugin with the options given and the corresponding environment variables.
| m | a map with keys documented in the plugin-specific header. |
| env_prefix | is 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 176 of file script.ipp.
|
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 183 of file script.ipp.
|
inlinevirtual |
Ready the plugin to publish following the configuration options set or defaulted.
Implements adc::publisher_api.
Definition at line 187 of file script.ipp.
|
inlinevirtual |
Stop publishing and release any resources held for managing publication.
Implements adc::publisher_api.
Definition at line 215 of file script.ipp.
|
inlinevirtual |
Pause publishing until a call to resume. Duplicate calls are allowed.
Implements adc::publisher_api.
Definition at line 227 of file script.ipp.
|
inlinevirtual |
Resume publishing Duplicate calls are allowed.
Implements adc::publisher_api.
Definition at line 231 of file script.ipp.
|
inlinevirtual |
Implements adc::publisher_api.
Definition at line 235 of file script.ipp.
|
inlinevirtual |
Implements adc::publisher_api.
Definition at line 239 of file script.ipp.
|
inlinestatic |
The default scratch directory for user script messages. This directory must be globally writable and should be fast. Overridden with env("ADC_SCRIPT_PLUGIN_DIRECTORY").
Definition at line 38 of file script.ipp.
|
inlinestatic |
The default path to a user script or program. This program should be user accessible. Overridden with env("ADC_SCRIPT_PLUGIN_PROG"). The default : is a non-operation.
Definition at line 44 of file script.ipp.
|
inlinestatic |
ADC script plugin enable debug messages; (default "0": none) "2" provides message send debugging "1" provides lighter debugging Overridden with env("ADC_SCRIPT_PLUGIN_DEBUG").
Definition at line 50 of file script.ipp.