Logger: A Log4j-like library for LabVIEW™
This add-on can be used to create a robust, full-feature application logging and error-handling system for any LabVIEW-based application. Logging statements are written as Comma-Separated Values (CSV) lines to a log file. Log files are managed and organized by calendar date and file name to reduce clutter and on-disk storage space. Logging can be configured to automatically close and create a new log file based on file size. Advanced error-handling capabilities are provided by combining level-based application logging with the LabVIEW General Error Handler VI to easily catch, log, clear, and display errors based on verbosity, severity, and configuration. The library is written 100% in LabVIEW and can run on any system that can run LabVIEW.
- HTML Help Workshop (for compiling the help documentation)
- JKI State Machine
- LabVIEW 2010 or newer (for building)
- LabVIEW 2018 or newer (for development)
- Labricator (only for automated builds, private package)
- OpenG Array Library
- OpenG File Library
- VIPM Pro (only for automated builds)
- VIPM API (only for automated builds)
The Caraya, JKI State Machine, OpenG Array Library, OpenG File Library, and VIPM API dependencies must be installed for all versions of LabVIEW (2010 and 2018) to avoid errors during automated builds.
- Navigate to the Logger package at VIPM.io.
- Click on the Install button to the right. The VI Package Manager (VIPM) (freely available from JKI) will start automatically.
- Follow the on-screen instructions to complete the installation.
Alternatively, the toolkit can be installed by: (i) downloading the source code and building the VIP, (ii) downloading a VIP from the releases section of this project, or (iii) manually copying the VIs from the source code into a project.
Packaging using VIPM Pro (recommended)
Important, if creating a package for LabVIEW 2010 from LabVIEW 2018, the VI Server TCP/IP ports must be different for each version of LabVIEW and verified with the VIPM application before proceeding. An error will occur when the VIPM is started if both LabVIEW 2010 and 2018 are running at the same time. Basically, VIPM will not know which VI server to use if both versions of LabVIEW are using the same TCP/IP port.
If VIPM Pro is available, then open the
Logger.lvproj file in any version of LabVIEW newer than 2010 and run the
Package.vi located in the
Scripts project library of the Project Explorer window. Ensure all dependencies are installed before running the
Note, the version number for the package is set in the
configs\Logger.vipb file. The version number in the VIP build specification file should be modified and saved before running the
Packaging using VIPM Free
If VIPM Pro is not available, then the following steps can be executed to do essentially the same thing as the
Package.vi script. Ensure all dependencies, except VIPM Pro and the VIPM API, are installed before completing these steps.
- Start LabVIEW 2018 or newer and open the
- From the Project Explorer window, File>>Save for Previous Version..., a new dialog will appear.
- Select 10.0 from the drop down menu.
- Click Save.... A new dialog will open.
- Create the
<project root>\target\10.0folder hierarchy in the project root, i.e. the same folder as the
Logger.lvprojfile, if it does not already exists.
- Click Save.
- Close LabVIEW 2018 or newer and the
- Navigate to
- Copy the
- Start LabVIEW 2010.
- Open the
<project root>\target\10.0\Logger.lvprojfile. Do NOT open the project in any other version of LabVIEW.
- Run the
Scriptsproject library to build each Source Distribution under the "Build Specifications" tree item and the compiled help documentation file (
Logger.chm). The output of each build will be available in
- Open the
<project root>\target\10.0\configs\Logger.vipbfile in VIPM.
- Build the VI package with VIPM. The output will be available at
<project root>\target\10.0\packages. Do NOT modify anything in the package build specification, but ensure the "2010" version of LabVIEW is selected in the upper, right-hand corner of the VIPM application window.
- Close VIPM.
- Close LabVIEW 2010 and the
See the in-app LabVIEW Help system for more information and documentation about using the library after it has been installed. Examples are also available within the LabVIEW development environment.
Tests are written in LabVIEW using the Caraya unit testing framework and included in the project via the
Tests.lvlib project library and the
tests on-disk folder. To run the tests, open the
Logger.lvproj file found in the project root in the LabVIEW Development Environment and run the
Test.vi script located in the
Scripts.lvlib project library. This will run all of the tests defined in the project.