Created by: ghost
...with great power comes great responsibility and such. I've tested it quite a bit - but not super extensively. I don't think it will eat your cat and have built it in a forward-focused but backwards compatible manner.
What that means is that this script can 'literally' be a drop in replacement for the echo
used in files currently. It will take the flags and input, log to systemd's JournalD and then spit the input text back out. This means it's effectively still just a plain echo to anything it's piped into.
So in the case of the gridpane-fix-tools.sh
I might just find and replace every echo
with:
./gridpane-logger.sh --info -p "fix-tool"
. Then if we want to be really granular you can go back and add a .function
and swap --info
for --debug
for really debug specific info.
The find and replace is an interesting stop-gap this allows - but all should likely be reclassified as needed, but info is a safe default for everything. And it's also the default so not strictly necessary in that right.
The only flag I suggest at minimum is the -p
flag to prefix the output lines sent to journald. Long-term this will benefit us most once we're able to get the grep feature of journalctl
working correctly...but that's a whole different can of worms.