A small CLI tool that logs login attempts to ~/.passwordlogger/ as JSON lines (JSONL), hashes usernames deterministically, tracks failed attempts, and provides a log viewer with filters.
- JSONL log format for easy parsing
- Deterministic username hashing (MD5, 8 hex chars)
- Persistent failed-attempt counter
- Log viewer filters for date, user, status, and IP
The log and counter are stored in ~/.passwordlogger/.
Each line in attempts.jsonl is a JSON object:
{"timestamp":"2024-01-15T14:32:45Z","user_hash":"7a2f9c4e","status":"failed","ip":"192.168.1.100"}Fields:
timestamp: UTC ISO 8601 withZuser_hash: first 8 hex chars of MD5 of the raw usernamestatus:successorfailedip: optional string
Log attempts:
python main.py attempt bob failed 192.168.1.100
python main.py attempt alice successView logs:
python main.py view
python main.py view --failed
python main.py view --user bob
python main.py view --date 2024-01-15
python main.py view --date 2024-01-01..2024-01-31Show failed counter:
python main.py counterA small demo is included to exercise the logger without touching your real user data directory.
python demo.pyRun the test suite with pytest:
python -m pytest