Bugger! provides a systemd Target as well as a Service Template to facilitate "plug-in" functionality for log gathering.
In order to add your script to the Bugger! log collector, do the following:
- create a POSIX shell script which outputs logging to standard output
- name the script
gather-logs-$YOURNAME.sh
- place the script into
/usr/share/harbour-bugger/scripts
and set it executable - use the systemd template service
[email protected]
to add your script to the plugin service. I.e. dosystemctl --user enable harbour-bugger-gather-logs-plugin@$YOURNAME.service
The template adds a dependency on theharbour-bugger-gather-logs.target
target, which is called by the app.
Notes:
- Bugger! will run the log creation, but will not add the created log files in the app. Users will have to select them manually.
- The script will be run from systemd with
/bin/sh -c "scriptname"
, so make sure its is /bin/sh compatible! - log output will be written to
~/Documents/Bugger/YYYY-MM-DD_harbour-bugger-gather-logs-plugin@$YOURNAME.log
[email protected]
usesProtectSystem=full
, so don't expect any location to be writable in your script.- scripts are run in systemd user scope. You can't be root. If you need to be
root, use
pkexec
to prompt users for the lock code/fingerprint.
Of course, you are free to not use the Service Template and just depend on the Target from any custom systemd services you have written.
If your log collecting script is part of a package, you can depend on
harbour-bugger-gather-logs
to make sure the infrastructure is installed.
A very basic "Hello World" example is in the contrib
folder and part of the
harbour-bugger-gather-logs-contrib
package.
Is places a script in /usr/share/harbour-bugger/scripts
and can be activated by doing
systemctl --user enable [email protected]`
If you would like to add a log collection script to the -contrib package,
please file a Pull Request, placing the script in the contrib
directory.