Skip to content

Instantly share code, notes, and snippets.

@thedaniel
Last active December 7, 2018 10:44
Show Gist options
  • Save thedaniel/c7309974632544832a987ff0a42dc214 to your computer and use it in GitHub Desktop.
Save thedaniel/c7309974632544832a987ff0a42dc214 to your computer and use it in GitHub Desktop.
Easy support bundles on OS X

If your desktop app writes to syslog on a Mac (e.g. with python's syslog module or similar) with a unique string you can grep for (in the python example, set as a param to syslog.openlog and shown below as my-custom-log-ident), and you are in some kind of locked-down corporate environment that makes real app analytics difficult or impossible, or you just want a 5 minute solution, try this:

Make a folder called something like MySupport.app. Put a single executable file in this folder with the same name, e.g. MySupport - this will make the folder appear as a normal OSX app, double-clickable and all. Then put some super simple bash in that file:

#!/bin/bash
current_time=$(date "+%Y.%m.%d-%H.%M.%S")
filename=~/Documents/my-support-$current_time.log
grep my-custom-log-ident /var/log/system.log > $filename
osascript -e 'display notification "Support log created in Documents folder" with title "MySupport"'

This will pop a Notification Center notification and copy the log to their Documents folder.

You can obviously do whatever else you want in this bash script, make a zip, copy some bitcoin wallets, whatever.

Have your user run it when they have a problem and email you the file!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment