Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,7 @@ Temporary Items
*.bak
*.backup

# Build logs
build_log.txt
*.log

59 changes: 51 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# Makefile for SpeakType

.PHONY: help build clean test lint format run setup
.PHONY: help build clean test lint format run setup logs logs-live logs-errors logs-export

# Default target
help:
@echo "SpeakType - Available commands:"
@echo " make setup - Initial project setup"
@echo " make build - Build the project"
@echo " make run - Run the application"
@echo " make test - Run all tests"
@echo " make lint - Run SwiftLint"
@echo " make format - Format code with SwiftLint"
@echo " make clean - Clean build artifacts"
@echo " make setup - Initial project setup"
@echo " make build - Build the project"
@echo " make run - Run the application"
@echo " make test - Run all tests"
@echo " make lint - Run SwiftLint"
@echo " make format - Format code with SwiftLint"
@echo " make clean - Clean build artifacts"
@echo ""
@echo "Logging:"
@echo " make logs - View live logs"
@echo " make logs-live - Stream live logs (alias)"
@echo " make logs-errors - View recent errors"
@echo " make logs-export - Export last 24h logs to Desktop"

# Project setup
setup:
Expand Down Expand Up @@ -82,3 +88,40 @@ xcode:
@echo "Opening in Xcode..."
open speaktype.xcodeproj

# LOGGING COMMANDS

# View live logs
logs:
@echo "📱 Streaming SpeakType logs (Ctrl+C to stop)..."
@echo "Tip: Run 'make run' in another terminal first"
@echo ""
log stream --predicate 'process == "speaktype"' --level debug --style compact

# Alias for logs
logs-live: logs

# View recent errors
logs-errors:
@echo "❌ Recent SpeakType errors (last hour)..."
@log show --predicate 'process == "speaktype" AND messageType == error' --last 1h --style compact || echo "No errors found"

# View recent logs (last 30 minutes)
logs-recent:
@echo "📝 Recent SpeakType logs (last 30 minutes)..."
@log show --predicate 'process == "speaktype"' --last 30m --style compact

# Export logs to Desktop
logs-export:
@echo "💾 Exporting logs to Desktop..."
@mkdir -p ~/Desktop/SpeakType_Logs
@log show --predicate 'process == "speaktype"' --last 1d > ~/Desktop/SpeakType_Logs/app_logs_$(shell date +%Y%m%d_%H%M%S).txt
@echo "System: $(shell sw_vers -productVersion)" > ~/Desktop/SpeakType_Logs/system_info.txt
@echo "Date: $(shell date)" >> ~/Desktop/SpeakType_Logs/system_info.txt
@echo "✅ Logs exported to ~/Desktop/SpeakType_Logs/"
@open ~/Desktop/SpeakType_Logs/

# Open Console.app filtered to SpeakType
logs-console:
@echo "Opening Console.app..."
@open -a Console

Loading