fedora-messaging
fedora-messaging copied to clipboard
--terse support
Right now the default/docs version of the public consumer just prints out all of each message to stdout. This is nice, but it would be nice if there was something like fedmsg --terse where it just prints out a small subset to give you an idea of the message. This way you can see a lot more info, and can actually run it to watch what all is going on in fedora.
~ fedmsg-tail-3 --terse
[2019-04-11 17:32:02][fedmsg.crypto.utils INFO] Downloading x509 certificate from https://fedoraproject.org/fedmsg/ca.crt
[2019-04-11 17:32:03][fedmsg.crypto.utils INFO] Downloading x509 certificate from https://fedoraproject.org/fedmsg/crl.pem
[2019-04-11 17:32:03][fedmsg.commands INFO]
logger.odcs.internal.msg --
This is pretty easy to do and could be a callback we provide, but the way fedmsg "tersified" messages was fedora_fedmsg_meta_something_something and fedora-messaging relies on publishers to describe their messages so it'll look a bit messy during the transition since the generic terse message is just the message topic IIRC.
The callback would look something like:
def callback(message):
print(message.summary)
When applications define message schemas, we'll be able to define a printer callback that will print
"{} --{}".format(message.topic, message.summary)
and it'll output basically the same info.
Without message schemas, the conversion from dictionary to human-readable description is not possible (all that logic is in the fedmsg_meta_fedora_infrastructure
package).
Hopefully apps will define their message schemas soon!
Oh, synchronized replies, @jeremycline :-)
Hey! Is this something that there's still an interest in having? I could try and implement it if so!
Currently, the default/docs version of the public consumer simply prints out all of each message to stdout. While this is helpful, it would be more efficient to have an option like fedmsg --terse that prints out a smaller subset of the message. This would allow users to see more information and observe what is happening in Fedora more effectively.~ fedmsg-tail-3 --terse [2019-04-11 17:32:02][fedmsg.crypto.utils INFO] Downloading x509 certificate from https://fedoraproject.org/fedmsg/ca.crt [2019-04-11 17:32:03][fedmsg.crypto.utils INFO] Downloading x509 certificate from https://fedoraproject.org/fedmsg/crl.pem [2019-04-11 17:32:03][fedmsg.commands INFO] logger.odcs.internal.msg -- [2019-04-11 17:32:03][fedmsg.commands INFO] github.pull_request_review -- xiexingguo approved the changes on PR #27523 on ceph/ceph ceph/ceph#27523 (review) [2019-04-11 17:32:25][fedmsg.commands INFO] buildsys.task.state.change -- koschei's scratch build of cinnamon-session-4.0.0-2.fc30.src.rpm for f31 started http://koji.fedoraproject.org/koji/taskinfo?taskID=34120079
When applications define message schemas, a printer callback can be defined to print {} --{}. This way, the output will be similar but more efficient. However, without message schemas, converting from a dictionary to a human-readable description is not possible, as all that logic is in the fedmsg_meta_fedora_infrastructure package.
It is hoped that apps will define their message schemas soon!
@nirik @abompard If noone is working on it,may I work on this issue?