aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorTeddy Wing2023-09-30 02:41:34 +0200
committerTeddy Wing2023-09-30 02:41:34 +0200
commitccd903bf2136bf2e99262d995b3a98a0334ce221 (patch)
tree55029ded715ac9821fa6f0f4fb4f24594ebb538a /bin
parentf93058e072914e99bf677e360790c0866ad5ce5e (diff)
downloadBase-Windowed-Application-ccd903bf2136bf2e99262d995b3a98a0334ce221.tar.bz2
bin/log: Add script to stream logs from the application
I wanted a way to get logs from the application when running the bundle rather than invoking the binary directly on the command line. This command provides something similar to what you would get in Xcode.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/log12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/log b/bin/log
new file mode 100755
index 0000000..7d37ca5
--- /dev/null
+++ b/bin/log
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# log
+# Stream logs from the application.
+
+application_name="$(
+ /usr/libexec/PlistBuddy \
+ -c 'Print :CFBundleName' \
+ Info.plist
+)"
+
+log stream --predicate "process == '${application_name}'"