Jul 28, 2020, 22:23 by
jo...@pocketnc.com:
> Thanks for all the info, Cern!
>
> I dug a little deeper and on my Beaglebone that has a prebuilt MachineKit image from July of 2019 does not log rtapi_print_msg(RTAPI_MSG_ERR, ... ) calls to the msgd socket, nor the linuxcnc.error_channel. I also have another Beaglebone with a RIP install built from source back in March of this year. It behaves a little differently, but I haven't investigated too far. I know that some of my rtapi_print_msg calls were getting picked up by linuxcnc.error_channel and given there's work in progress to address logging issues, I'm not all that surprised by the difference in behavior. I'll let things shake out a little more before going further, but I appreciate all the help!
>
I recently shallowly investigated the logging because I was interested in what pats would need to be changed to kick the RTAPI/ULAPI compiler switches down to the trashbin of history. The logger is based on Simon Kelley's syslog_async code from
http://www.thekelleys.org.uk/syslog-async/ . But time moves ever forward and today there are nice libraries for quick logging like
https://github.com/RafaGago/mini-async-log-c ,
https://github.com/HardySimpson/zlog ,
https://github.com/zma/zlog/ and many others. None or very few of these are implemented with real-time systems in mind, so there is always work associated.
One of the reasons why I looked at it is because of the speed of logging, respective what is done on the producer side (i.e. in real-time thread) and what is done on the consumer side. (With rt preempt it is not going to be an issue, given the minimal latency, but with EVL Core I have been able to reach very nice lattencies where the logging speed and load will be important). But I haven't done any real testings yet.
However, all this being said - to be honest - in the set of things which must be done and issues needing repair in Machinekit, I consider this pretty low priority. (Sorry.) Any patches will be welcomed by me, and I am sure by other members of Machinekit community.
Cern.
>
> In case it helps anyone, I was able to connect to the msgd socket and did have to decode the messages in python like so:
> import zmq
> import time
> from machinetalk.protobuf.message_pb2 import Container
> from machinetalk.protobuf.types_pb2 import *
>
> context = zmq.Context()
> sub = context.socket(zmq.SUB)
> sub.setsockopt(zmq.SUBSCRIBE, "")
> sub.connect("ipc:///tmp/0.log.<MACHINEKIT MKUUID>")
> rx = Container()
> while True:
> msg = sub.recv()
> rx.ParseFromString(msg)
> print("Received message: %s" % (rx,))
>
> On Tue, Jul 28, 2020 at 2:08 PM <>
ce...@tuta.io> > wrote:
>
>> When I was playing with it some year or two back, I just looked at exported mDNS/DNS-SD/Bonjour services (there is a ton of programs for it on any platform), got the address of the socket and then simply used quick'n'dirty program written by the simple tutorial on >>
zeromq.org <
http://zeromq.org>>> . I am not sure if the logs are sent as a plain-text or encoded in Protocol Buffers messages. I think it is plaint-text, but if not, you would then need to decode it.
>> >> >>> To unsubscribe from this group and stop receiving emails from it, send an email to > >> >>
machinekit+...@googlegroups.com <mailto:
machinekit%2Bunsu...@googlegroups.com>>> <mailto:>>
machinekit%2Bunsu...@googlegroups.com <mailto:
machinekit%252Buns...@googlegroups.com>>> >>> > .
>> >> > To unsubscribe from this group and stop receiving emails from it, send an email to >> >>
machinekit+...@googlegroups.com <mailto:
machinekit%2Bunsu...@googlegroups.com>>> <mailto:>>
machinekit%2Bunsu...@googlegroups.com <mailto:
machinekit%252Buns...@googlegroups.com>>> >>> .
>> > To view this discussion on the web visit > >>
https://groups.google.com/d/msgid/machinekit/CAPEK9qZ4%3DP9QOWLLsqJVg%3DdQx2gBg6MaSG%3DwgOE2-H0b1Zu0cA%40mail.gmail.com>> <>>
https://groups.google.com/d/msgid/machinekit/CAPEK9qZ4%3DP9QOWLLsqJVg%3DdQx2gBg6MaSG%3DwgOE2-H0b1Zu0cA%40mail.gmail.com?utm_medium=email&utm_source=footer>> >> .
> To view this discussion on the web visit >
https://groups.google.com/d/msgid/machinekit/CAPEK9qaOtMo-7yhU9Noeu0uKFap-Ew5Z-4nMJb0qGO6i7tqZ%2BQ%40mail.gmail.com <
https://groups.google.com/d/msgid/machinekit/CAPEK9qaOtMo-7yhU9Noeu0uKFap-Ew5Z-4nMJb0qGO6i7tqZ%2BQ%40mail.gmail.com?utm_medium=email&utm_source=footer>> .
>