Quick Tip
Stop watching deploy logs scroll by. Make the log watch you:
# Linux — notify when the deploy finishes (or fails)
tail -f deploy.log | grep --line-buffered -E "SUCCESS|FAILED" | \
while read -r line; do
notify-send "Deploy" "$line"
done
# macOS equivalent
tail -f deploy.log | grep --line-buffered -E "SUCCESS|FAILED" | \
while read -r line; do
osascript -e "display notification \"$line\" with title \"Deploy\""
done
The key flag is --line-buffered — without it, grep buffers output in 4KB blocks and your notification arrives 20 minutes late (or never, if the log goes quiet).
Works on any piped stream, not just files:
# Ping me when the test suite hits a failure
pytest -v | grep --line-buffered "FAILED" | \
while read -r line; do notify-send "Test failed" "$line"; done
I keep this in a shell function so it's one word:
watchfor() { # usage: watchfor PATTERN
grep --line-buffered -E "$1" | while read -r line; do
notify-send "watchfor" "$line"
done
}
# tail -f app.log | watchfor "ERROR|CRITICAL"
Powered by MonkeyCode — free AI coding assistant.
What's the log line you wish had notified you before the standup meeting?
Top comments (0)