Miscellaneous¶
-
class
wishbone.config.configfile.ConfigFile(filename, logstyle, loglevel=6, identification='wishbone', colorize_stdout=True)[source]¶ Generates a wishbone.router configuration object used to initialize a wishbone router object.
This config generator has some tailered functionality which makes it suitable when bootstrapping from CLI.
It does following automatic configurations:
Initializes a
wishbone.module.flow.funnelmodule called_logswhich is connected to the_logsqueue of all modules except if this module has already been connected in the bootstrap file.Initializes a
wishbone.module.flow.funnelmodule called_metricswhich is connected to the_metricsqueue of all modules except if this module has already been connected in the bootstrap file. The_metricsmodules is by default not connected to any other modules. The effect of this is that all metrics are dropped unless the user connects a module for furhter processing the metrics.Adds a
wishbone.module.flow.queueselectmodule called_logs_filterresponsible for dropping logs which log level do not correspond to the define--log-levelAdds either a
wishbone.module.output.stdoutcalled_logs_stdoutmodule orwishbone.module.output.syslogmodule called_logs_syslogand connects this instance to_logs.outbox.Initializes the following template functions and makes them available to each initialized module:
- strftime() - env() - epoch() - version()
Parameters: - filename¶ – The filename of the configuration to load.
- logstyle¶ – How logging should be setup. Possible options are: stdout and syslog.
- loglevel¶ – The loglevel for the router to use to use.
- identification¶ – A string which identifies the router instance
- colorize_stdout¶ – When True, colors each stdout printed logline using proper coloring.
-
addConnection(source_module, source_queue, destination_module, destination_queue)[source]¶ Adds connections between module queues.
Parameters:
-
addModule(name, module, arguments={}, description='', functions={}, protocol=None, event=False)[source]¶ Adds a module to the configuration.
Parameters: - name¶ – The module instance name
- module¶ – The module name
- arguments¶ – The module variables
- description¶ – A description of the module instance
- functions¶ – The module functions
- protocol¶ – The protocol to apply to the module
- event¶ – Whether incoming or outgoing events need to be treated as full events.
-
addModuleFunction(name, function, arguments={})[source]¶ Adds a module function to the configuration.
Parameters: