Files
microdao-daarion/scripts/logging/session-log.sh
Apple 744c149300
Some checks failed
Build and Deploy Docs / build-and-deploy (push) Has been cancelled
Add automated session logging system
- Created logs/ structure (sessions, operations, incidents)
- Added session-start/log/end scripts
- Installed Git hooks for auto-logging commits/pushes
- Added shell integration for zsh
- Created CHANGELOG.md
- Documented today's session (2026-01-10)
2026-01-10 04:53:17 -08:00

44 lines
1.2 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# ============================================================
# session-log.sh — Додати запис до поточної сесії
# ============================================================
# Використання: ./scripts/logging/session-log.sh "Опис дії"
# Або через alias: session-log "Опис дії"
# ============================================================
PROJECT_DIR="/Users/apple/github-projects/microdao-daarion"
SESSIONS_DIR="$PROJECT_DIR/logs/sessions"
DATE=$(date +%Y-%m-%d)
TIME=$(date +%H:%M)
SESSION_FILE="${DAARION_SESSION_FILE:-$SESSIONS_DIR/${DATE}.md}"
MESSAGE="$*"
if [ -z "$MESSAGE" ]; then
echo "❌ Вкажіть опис дії"
echo "Використання: session-log \"Опис дії\""
exit 1
fi
# Якщо файл не існує — створити
if [ ! -f "$SESSION_FILE" ]; then
mkdir -p "$SESSIONS_DIR"
cat > "$SESSION_FILE" << EOF
# 📅 Session Log: $DATE
**Оператор:** Ivan + AI Assistant
**Проєкт:** DAARION & MicroDAO
---
## 📋 Хронологія дій
EOF
fi
# Додати запис
echo "- **$TIME** — $MESSAGE" >> "$SESSION_FILE"
echo "✅ Записано: $MESSAGE"