deeplog is a powerful and developer-friendly command-line tool that helps you fetch, filter, analyze, and summarize macOS system logs directly from the terminal.
Built with Node.js. Supports colorized CLI output, JSON formatting, compression, and more.
- Fetch system logs using native
logcommand - Apply custom
--predicatefilters - Choose log format:
syslogorjson - Save logs to custom file path (auto-creates folders)
- Automatically compress logs (
.gz) - Optionally delete original log file after compression
- Analyze logs:
- Keyword highlights:
error,fail,timeout,disconnect - Count of errors, warnings, info
- Top 5 frequent messages
- Top 5 active processes (with bar chart)
- Save analysis to
.summary.json
- Keyword highlights:
git clone https://github.com/your-username/deeplog-cli-nodejs.git
cd deeplog-cli-nodejs
npm install
chmod +x bin/index.js
npm link
π‘ Usage
π₯ Fetch Logs
node bin/index.js fetch --last 10m --output logs/errors.log
π§ͺ Add Filters
node bin/index.js fetch --last 30m \
--output logs/errors.json \
--predicate 'eventMessage CONTAINS "error"' \
--style json
π§Ή Auto-Compress & Delete
node bin/index.js fetch --last 5m \
--output logs/errors.log \
--delete-original
π Analyze Logs
node bin/index.js analyze logs/errors.json
With Summary Output
node bin/index.js analyze logs/errors.json --save-summary
Creates: logs/errors.json.summary.json
π Sample Output
π Log Levels:
β Errors: [βββββββββββββββββββββββββββ] 132
β οΈ Warnings: [ββββββββββββ] 45
βΉοΈ Info: [ββββββββββββββββ] 98
π§ Top Processes:
ZscalerTunnel [ββββββββββββββββββββββββββββ] 4197
com.cisco.anyconnect [ββββββββββββββββββββ] 1620
Docker.app [ββββββββββ] 879
Cursor Helper [βββββββ] 659
UPMServiceControl [βββββ] 480
π Project Structure
deeplog-cli-nodejs/
βββ bin/
β βββ index.js # CLI entry point
βββ commands/
β βββ fetch.js # Fetch logs command
β βββ analyze.js # Analyze logs command
βββ package.json
βββ README.md
π οΈ Requirements
macOS (uses log show)
Node.js 18+