import pika
import sys

connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()

channel.exchange_declare(exchange='Logs', exchange_type='fanout')

message = ' '.join(sys.argv[1:]) or "Info: Hello I have a cat, Busia, and a dog, Bonya!"
channel.basic_publish(exchange='Logs', routing_key='', body=message)
print(f" [x] Отправлено сообщение: {message}")
connection.close()