Log Messages About Your Code

Log Messages

I use the UserLog library to help describe what my code is doing :face_with_monocle:. Machine HMIs provide valuable information through alarms and diagnostic screens :woman_office_worker:. However, it may not always explain what the code is doing :person_shrugging:.

2023-11-17_14-54-04

The UserLog library is for programmers who want a written narrative of how their code is executing.

Advantages

:white_check_mark: Bundles ArEventLog function blocks into easy single-call functions.
:white_check_mark: Use directly in FOR loops and nested conditional statements.
:white_check_mark: Log application events alongside B&R product events in the Automation Studio logger.
:white_check_mark: Utilize the built-in User logbook.
:white_check_mark: Supports in-line string formatting for multiple data types.
:white_check_mark: Manage logging verbosity.

Disadvantages

:x: What are you going to do with all the time saved rapidly debugging code from your excellent logging? :sunglasses:

Download

Download the library here.
This is not an official library and is supported by the community. Source code, documentation, and issues are manages through GitHub.

6 Likes

Nice of you to provide your simple log library. I was often thinking about releasing our B&R CH library which we use at many customers, but never found the time.

I saw you released the library under the GPL3 license. As I understand this would be a big issue for most automation companies, because if you link a library with GPL3 in your project, your software must also be GPL3 or compatible to GPL3.

If you want to provide your library for free without the requirement to make all user software open source, you could for example use the MIT license, which is much more permissive.