Skip to content

Commit aba42c9

Browse files
committed
Add debug logging to the app
1 parent 1362af1 commit aba42c9

8 files changed

Lines changed: 217 additions & 7 deletions

File tree

changelog.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Changelog
22
**All dates are in YYYY/MM/DD (Year-Month-Day)**
33

4+
## [1.1.3] - 2025-06-06
5+
6+
### Added
7+
- **Debug Logging System**: Comprehensive debug logging infrastructure for troubleshooting
8+
- Debug log file creation with automatic rotation (5MB max size, 5 file rotation)
9+
- Debug logs stored in application data directory (`userData/logs/debug.log`)
10+
- "Show Debug Logs" button in Settings panel for easy access to log files
11+
- Debug logging throughout main application processes including:
12+
- Application startup and window creation
13+
- API key operations and validation
14+
- File selection and transcription workflows
15+
- Audio processing and FFmpeg operations
16+
- Settings management
17+
- Update checking functionality
18+
19+
### Enhanced
20+
- Improved troubleshooting capabilities for users and developers
21+
- Better error tracking and application state monitoring
22+
- Enhanced support workflow with detailed logging information
23+
424
## [1.1.2] - 2025-06-06
525

626
### Changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "autocaption",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "Automatic caption generation app using OpenAI Whisper",
55
"main": "src/main.js",
66
"scripts": {

src/app.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class AutoCaptionApp {
6565
document.getElementById('save-settings-btn').addEventListener('click', () => this.saveSettings());
6666
document.getElementById('cancel-settings-btn').addEventListener('click', () => this.closeSettings());
6767
document.getElementById('manual-check-updates-btn').addEventListener('click', () => this.checkForUpdates());
68+
document.getElementById('show-debug-logs-btn').addEventListener('click', () => this.openDebugLogs());
6869

6970
// Modal backdrop click to close
7071
document.getElementById('settings-modal').addEventListener('click', (e) => {
@@ -397,6 +398,42 @@ class AutoCaptionApp {
397398
}
398399
}
399400

401+
async openDebugLogs() {
402+
const button = document.getElementById('show-debug-logs-btn');
403+
const originalText = button.innerHTML;
404+
405+
// Show loading state
406+
button.innerHTML = '<span>📄 Opening...</span>';
407+
button.disabled = true;
408+
409+
try {
410+
const result = await window.electronAPI.openDebugLogs();
411+
if (!result.success) {
412+
console.error('Failed to open debug logs:', result.error);
413+
// Show temporary error message
414+
button.innerHTML = '<span>❌ Error</span>';
415+
setTimeout(() => {
416+
button.innerHTML = originalText;
417+
button.disabled = false;
418+
}, 2000);
419+
} else {
420+
// Show success message briefly
421+
button.innerHTML = '<span>✅ Opened</span>';
422+
setTimeout(() => {
423+
button.innerHTML = originalText;
424+
button.disabled = false;
425+
}, 1500);
426+
}
427+
} catch (error) {
428+
console.error('Error opening debug logs:', error);
429+
button.innerHTML = '<span>❌ Error</span>';
430+
setTimeout(() => {
431+
button.innerHTML = originalText;
432+
button.disabled = false;
433+
}, 2000);
434+
}
435+
}
436+
400437
updateLastCheckInfo() {
401438
const lastCheckInfo = document.getElementById('last-check-info');
402439
if (this.settings?.lastUpdateCheck) {

src/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,20 @@ <h3>🔄 Updates</h3>
5959
<div class="setting-group">
6060
<h3>ℹ️ About</h3>
6161
<div class="setting-item">
62-
<p><strong>Version:</strong> 1.1.2</p>
62+
<p><strong>Version:</strong> 1.1.3</p>
6363
<p><strong>Made with ❤️ by Jay</strong></p>
6464
<p>Using OpenAI Whisper for AI-powered transcription</p>
6565
</div>
6666
</div>
67+
<div class="setting-group">
68+
<h3>🐛 Debug</h3>
69+
<div class="setting-item">
70+
<button id="show-debug-logs-btn" class="btn btn-secondary">
71+
<span>📄 Show Debug Logs</span>
72+
</button>
73+
<p class="setting-description">Open the debug log file to view detailed application logs for troubleshooting.</p>
74+
</div>
75+
</div>
6776
</div>
6877
<div class="modal-footer">
6978
<button id="save-settings-btn" class="btn btn-primary">Save Settings</button>

0 commit comments

Comments
 (0)