https://github.com/tmatijevich/UserLog
Write to user logbooks synchronously
https://github.com/tmatijevich/UserLog
automation-studio iec61131-3 library logging verbosity
Last synced: about 1 year ago
JSON representation
Write to user logbooks synchronously
- Host: GitHub
- URL: https://github.com/tmatijevich/UserLog
- Owner: tmatijevich
- License: mit
- Created: 2021-09-14T22:03:37.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-14T04:21:00.000Z (about 2 years ago)
- Last Synced: 2025-04-01T02:16:58.830Z (about 1 year ago)
- Topics: automation-studio, iec61131-3, library, logging, verbosity
- Language: C
- Homepage:
- Size: 159 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-b-r - UserLog - Write to user logbooks synchronously. (Infrastructure / Tracing and logging)
README
# UserLog
[](https://www.br-automation.com)


[](https://github.com/tmatijevich/UserLog/issues)
UserLog is an [Automation Studio](https://www.br-automation.com/en-us/products/software/automation-software/automation-studio/) library for writing to user logbooks synchronously.
UserLog's simple one-line functions provide an essential **diagnostic tool** for software development.
**NOTE:** This is not an official library and is supported through the community. UserLog is provided as-is under the [MIT License](https://mit-license.org/) agreement. Source code, documentation, and issues are managed through [GitHub](https://github.com/tmatijevich/UserLog).

# Features
- :repeat: Write to logbooks synchronously
- :pencil2: Fully customizable with message, code, and runtime data parameters
- :warning: Suppress messages with adjustable severity level
- :orange_book: Create custom logbooks
- :clipboard: Compatible with text system
Function | Description
---|---
[UserLogBasic](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L2) | Write to the User logbook synchronously
[UserLogAdvanced](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L10) | Write to the User logbook with runtime data
[UserLogCustom](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L19) | Write to any user logbook synchronously
[UserLogEventText](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L32) | Write to any user logbook through binary-encoded data and event texts
[UserLogCreate](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L43) | Create a custom logbook in an Init subroutine
[UserLogSetSeverityLevel](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L50) | Suppress messages below the input level and return previous level
[UserLogGetSeverity](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L56) | Get ArEventLog severity from an event ID
[UserLogGetFacility](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L62) | Get ArEventLog facility from an event ID
[UserLogGetCode](https://github.com/tmatijevich/UserLog/blob/main/UserLog.fun?ts=4#L68) | Get ArEventLog code from an event ID
# Install
1. [Download](https://github.com/tmatijevich/UserLog/releases/latest/download/UserLog.zip) the binaries and extract the archive
2. Add to the project as **existing library** from the toolbox in logical view
# Build
- Clone or download source files
- Add to the project as **existing library**
- Option to add as **reference**
Alternatively, add as submodule to an existing project repository.
```
cd
git submodule add https://github.com/tmatijevich/UserLog.git /Logical/Libraries/UserLog
```
Then add to project as **existing library**.
Users must add the following **additional build options** under the UserLog object's compiler properties in the software configuration.
```
-D IECSTRING_HEADER_EXPLICIT -D IECSTRING_FORMAT_TYPE_EXTERNAL
```
# Unit Tests
See the [UserLogProject](https://github.com/tmatijevich/UserLogProject) for unit tests of all functions.
# Documentation
Once installed, the help file can be viewed using the `F1` function key.
See the [UserLogHelp](https://github.com/tmatijevich/UserLogHelp) for the documentation source code.
### Dependencies
- [ArEventLog](https://help.br-automation.com/#/en/4/libraries%2Fareventlog%2Fareventlog.html)
- [sys_lib](https://help.br-automation.com/#/en/4/libraries%2Fsys_lib%2Fsys_lib.html)
- [astime](https://help.br-automation.com/#/en/4/libraries%2Fastime%2Fastime.html)
### Authors
- Tyler Matijevich ([@tmatijevich](https://github.com/tmatijevich))