Package: pymygdala
# PymygdalaA CAPO aware library and suite of CLIs for interacting with RabbitMQ. This work borrows heavily from python-logging-rabbit, which can be found here:https://github.com/albertomr86/python-logging-rabbitmq/tree/master/python_logging_rabbitmq## RequirementsThis library depends on pycapo and Pika.## Usage### Logging APIThis is the minimal use case, where Pymygdala gets connection details from CAPO and relies on the defaults where it can.log = logging.getLogger(__name__)log.setlevel(logging.DEBUG)handler = LogHandler(profile='test', application='test-app',level=logging.INFO)log.addHandler(handler)log.error("there are eels in my hovercraft")### Logging CLIpym-sendlog, 0.2.0: a command line tool for logging to RabbitMQ.optional arguments:-h, --help            show this help message and exit--profile PROFILE     CAPO profile name to use, e.g. test, production--exchange EXCHANGE   exchange name to use, e.g. archive.logs--type EXCHANGE_TYPE  exchange type to use, e.g. fanout--hostname HOSTNAME   server name of the RabbitMQ server--username USERNAME   username of the RabbitMQ server--password PASSWORD   password of the RabbitMQ server--port PORT           port number of the RabbitMQ server--key ROUTING_KEY     routing key, e.g. archive.logsrequired arguments:--level LEVEL         logging level, e.g. DEBUG, WARN--message MESSAGE     message to log--app APPLICATION     the application name to log as### DumpLogs CLIpym-dumplogs, 0.2.0: connect to a RabbitMQ server and dump out logs.optional arguments:-h, --help            show this help message and exit--profile PROFILE     CAPO profile name to use, e.g. test, production--exchange EXCHANGE   exchange name to use, e.g. archive.logs--type EXCHANGE_TYPE  exchange type to use, e.g. fanout--hostname HOSTNAME   server name of the RabbitMQ server--username USERNAME   username of the RabbitMQ server--password PASSWORD   password of the RabbitMQ server--port PORT           port number of the RabbitMQ server--outfile OUTFILE     write output to file, - for STDOUTThis is the pym-dumplogs epilog.### Sending an event, APImessage = {'eventName': settings['metadata']['workflow'],'type': settings['metadata']['type'],'additionalPaths': [],'metadata': settings['metadata']}se = SendEvent(**settings)se.send(json.dumps(message))### Sending an event, CLIThis is the pym-sendevent description, 0.2.0optional arguments:-h, --help            show this help message and exit--profile PROFILE     CAPO profile name to use, e.g. test, production--exchange EXCHANGE   exchange name to use, e.g. archive.logs--type EXCHANGE_TYPE  exchange type to use, e.g. fanout--hostname HOSTNAME   server name of the RabbitMQ server--username USERNAME   username of the RabbitMQ server--password PASSWORD   password of the RabbitMQ server--port PORT           port number of the RabbitMQ server--key ROUTING_KEY     routing key, e.g. archive.logs--metadata METADATA   provide a KEY=VALUE pair to be passed to RabbitMQ; can be used multiple timesThis is the pym-sendevent epilog.0.2.2   2017-07-17  Fix to tone down timestamp's fractional seconds to something reasonable0.2.1	2017-07-10	Quick bugfix on SendNRAOEvent0.2.0	2017-07-06	Major refactor, added pym-dumplogs, pym-sendlog, pym-sendevent CLI apps, docs and more goodness0.1.1	2017-06-28	Packaging fixes, first pypi release0.0.1	2017-01-31	Initial release plus logging