
X4 Log Watcher is a simple tool to monitor the log files of X4: Foundations. It provides a graphical interface to view and filter log entries, making it easier to analyze the game's output.
Features
- Real-time log monitoring
- Filter log entries by regular expressions
- Multi-tabbed interface for filtering the same log file
- Enable/disable filters on the fly per each tab
- Watch not only the exact log file but also the parent directory to reload the log file when new log files are created
- Support profiles saving and loading - i.e. current tabs with filters
- Offline mode - i.e. load the log file from disk and parse it
- Loading default profile on startup
- Support a "Forced refresh" mode, if by some reason standard Windows file watcher doesn't work
- Support simple text search in current filtered content via Ctrl+F and F3(Enter)/Shift+F3 for next/previous search result
- Has a status bar with the current log file name and it's stats. Additionally shows the loading progress of the log file in the offline mode
- Shows the updates in non-focused tabs via "bolding" and adding the notification symbol "
" to the tab name
- Extension for the log file is configurable via editing of the config file. By default, it is set to .log
- Has option to skip the signature related errors in the log file. By default, it is set to true
- Has option to add "real" timestamp to the filtered content. By default, it is set to false
- Supports AutoTabs feature - automatically create tabs based on the appropriate regex pattern from log file content
- Supports multi-lined log entries, allowing the tool to handle log entries that span multiple lines
Windows 10 or later
Installation
Simply download a X4LogWatcher.zip file from:
- Nexus Mods X4 Log Watcher
- GitHub Releases page.
Important Note
Please ensure that you started the X4 with appropriate command line switches to produce a log files.
Details on how to do this can be found in the HOWTO - Hacking X4 Foundations
Notice: Please set the extension for the debug log to .log!
Usage
To use X4 Log Watcher, follow these steps:
- Launch the application.
Spoiler
Show

- Use the filtering options to customize the log entries displayed.
Spoiler
Show

- Save your profile for future sessions.
Spoiler
Show

- Select the log file you want to monitor or choose a directory to watch.
Spoiler
Show

Spoiler
Show

The tool can now handle log entries that span multiple lines, making it easier to read and analyze complex log messages. Regex patterns can be applied to only the first line of the multi-lined entry. Same rule is applied to the AutoTabs and TimeStamping features.
Spoiler
Show

From version 0.6.0 onwards, the application supports the AutoTabs feature. This feature allows you to automatically create tabs based on the log file content. The application will analyze the log file and create tabs for each unique entry, making it easier to monitor multiple entries simultaneously.
The key point of it - the regular expression pattern with mandatory named group unique. The tool will check the log lines against this pattern and create tabs for each unique match.
Let's assume we need an AutoTabs for the move.idle script.
Log line looks like this:
Code: Select all
[Scripts] 1689391.54 *** aicontext<move.idle,0x75840>: about to finish idle. moving to anchor position.
Spoiler
Show

Spoiler
Show

Spoiler
Show

Spoiler
Show

Known Issues
In some cases, the application may not detect changes in the log file. If this happens, you can enable the "Forced refresh" mode in the menu. This will force the application to check for changes in the log file at regular intervals.
Will work in case if any watch mode is enabled.
In some cases too many tabs can fill a whole window of a tool. There is limitation of used framework. Let's limit an AutoTabs feature in this case.
Links
- A short demo showcasing the tool features introduced in version 0.2.0: X4 Log Watcher Demo.
- A short demo showcasing the new features introduced in version 0.3.0: X4 Log Watcher Demo - Version 0.3.0.
- A short demo showcasing the new features introduced in version 0.4.0: X4 Log Watcher Demo - Version 0.4.0.
- A short demo showcasing the new features introduced in version 0.6.0: X4 Log Watcher Demo - Version 0.6.0.
- There is a topic on the Egosoft forum, related to this tool.
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.