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.funnel
module called_logs
which is connected to the_logs
queue of all modules except if this module has already been connected in the bootstrap file.Initializes a
wishbone.module.flow.funnel
module called_metrics
which is connected to the_metrics
queue of all modules except if this module has already been connected in the bootstrap file. The_metrics
modules 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.queueselect
module called_logs_filter
responsible for dropping logs which log level do not correspond to the define--log-level
Adds either a
wishbone.module.output.stdout
called_logs_stdout
module orwishbone.module.output.syslog
module called_logs_syslog
and 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: