Add Open Logs button and simplify bug template
Add an 'Open Logs' button to the About dialog that opens the app log folder via QDesktopServices/QUrl, ensures the log directory exists, and logs warnings/errors. Include minimal styling and a handler (open_logs_folder) that uses APP_LOG_DIR and the logger. Also update settings dialog imports to include QUrl/QDesktopServices and APP_LOG_DIR. Simplify the bug report template to instruct users to open logs from the About dialog and attach ytsage.log / ytsage_error.log.
This commit is contained in:
@@ -45,14 +45,10 @@ assignees: ''
|
|||||||
Attach screenshots (for GUI issues) or terminal logs (for CLI errors).
|
Attach screenshots (for GUI issues) or terminal logs (for CLI errors).
|
||||||
|
|
||||||
To collect log files:
|
To collect log files:
|
||||||
1. Go to the logs folder:
|
1. Open YTSage and reproduce the issue.
|
||||||
- Windows: %LOCALAPPDATA%\YTSage\logs
|
2. Click the **About** button.
|
||||||
- macOS: ~/Library/Application Support/YTSage/logs
|
3. Click **Logs** (📂) to open the logs folder.
|
||||||
- Linux: ~/.local/share/YTSage/logs
|
4. Attach `ytsage.log` and `ytsage_error.log`.
|
||||||
2. Delete all files in that folder
|
|
||||||
3. Open the app and reproduce the issue
|
|
||||||
4. Go back to the logs folder - you should find two new log files (ytsage.log, ytsage_errors.log)
|
|
||||||
5. Attach those log files to this issue
|
|
||||||
|
|
||||||
Use ``` to format logs:
|
Use ``` to format logs:
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ Contains basic utility dialogs like LogWindow and AboutDialog.
|
|||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from PySide6.QtCore import Qt, QThread, QTimer, Signal
|
from PySide6.QtCore import Qt, QThread, QTimer, Signal, QUrl
|
||||||
|
from PySide6.QtGui import QDesktopServices
|
||||||
from PySide6.QtWidgets import (
|
from PySide6.QtWidgets import (
|
||||||
QDialog,
|
QDialog,
|
||||||
QDialogButtonBox,
|
QDialogButtonBox,
|
||||||
@@ -21,6 +22,8 @@ from PySide6.QtWidgets import (
|
|||||||
|
|
||||||
from ... import __version__ as APP_VERSION
|
from ... import __version__ as APP_VERSION
|
||||||
from ...utils.ytsage_localization import _
|
from ...utils.ytsage_localization import _
|
||||||
|
from ...utils.ytsage_logger import logger
|
||||||
|
from ...utils.ytsage_constants import APP_LOG_DIR
|
||||||
|
|
||||||
from ...core.ytsage_ffmpeg import get_ffmpeg_path
|
from ...core.ytsage_ffmpeg import get_ffmpeg_path
|
||||||
from ...core.ytsage_utils import _version_cache, check_ffmpeg, get_ffmpeg_version, get_ytdlp_version, get_deno_version, refresh_version_cache
|
from ...core.ytsage_utils import _version_cache, check_ffmpeg, get_ffmpeg_version, get_ytdlp_version, get_deno_version, refresh_version_cache
|
||||||
@@ -288,6 +291,34 @@ class AboutDialog(QDialog):
|
|||||||
# Add stretch to push refresh button to the right
|
# Add stretch to push refresh button to the right
|
||||||
header_layout.addStretch()
|
header_layout.addStretch()
|
||||||
|
|
||||||
|
# Create logs button (minimal)
|
||||||
|
self.logs_btn = QPushButton(_("about.open_logs")) # Expected to be small text or icon
|
||||||
|
self.logs_btn.setToolTip(_("about.logs_tooltip"))
|
||||||
|
self.logs_btn.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||||
|
self.logs_btn.setStyleSheet(
|
||||||
|
"""
|
||||||
|
QPushButton {
|
||||||
|
padding: 1px 6px;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 1px solid #333;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #888888;
|
||||||
|
font-size: 10px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
QPushButton:hover {
|
||||||
|
color: #ffffff;
|
||||||
|
border-color: #555;
|
||||||
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
|
}
|
||||||
|
QPushButton:pressed {
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
self.logs_btn.clicked.connect(self.open_logs_folder)
|
||||||
|
header_layout.addWidget(self.logs_btn)
|
||||||
|
|
||||||
# Create refresh button
|
# Create refresh button
|
||||||
self.refresh_btn = QPushButton(_("about.refresh"))
|
self.refresh_btn = QPushButton(_("about.refresh"))
|
||||||
self.refresh_btn.setFixedSize(16, 16)
|
self.refresh_btn.setFixedSize(16, 16)
|
||||||
@@ -532,6 +563,20 @@ class AboutDialog(QDialog):
|
|||||||
self.status_container.addWidget(deno_item)
|
self.status_container.addWidget(deno_item)
|
||||||
|
|
||||||
|
|
||||||
|
def open_logs_folder(self):
|
||||||
|
"""Open the application logs folder in the system file explorer."""
|
||||||
|
try:
|
||||||
|
if not APP_LOG_DIR.exists():
|
||||||
|
logger.warning(f"Log directory does not exist: {APP_LOG_DIR}")
|
||||||
|
APP_LOG_DIR.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
log_url = QUrl.fromLocalFile(str(APP_LOG_DIR))
|
||||||
|
QDesktopServices.openUrl(log_url)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Failed to open log folder: {e}")
|
||||||
|
# Minimal error feedback since this is about dialog
|
||||||
|
self.logs_btn.setToolTip(f"Error: {str(e)}")
|
||||||
|
|
||||||
def refresh_version_info(self) -> None:
|
def refresh_version_info(self) -> None:
|
||||||
"""Refresh version information manually."""
|
"""Refresh version information manually."""
|
||||||
self.refresh_btn.setText(_('about.refreshing'))
|
self.refresh_btn.setText(_('about.refreshing'))
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
from packaging import version as version_parser
|
from packaging import version as version_parser
|
||||||
from PySide6.QtCore import Qt, QTimer
|
from PySide6.QtCore import Qt, QTimer, QUrl
|
||||||
|
from PySide6.QtGui import QDesktopServices
|
||||||
from PySide6.QtWidgets import (
|
from PySide6.QtWidgets import (
|
||||||
QButtonGroup,
|
QButtonGroup,
|
||||||
QCheckBox,
|
QCheckBox,
|
||||||
@@ -30,6 +31,7 @@ from PySide6.QtWidgets import (
|
|||||||
from ...utils.ytsage_logger import logger
|
from ...utils.ytsage_logger import logger
|
||||||
from ...utils.ytsage_localization import _
|
from ...utils.ytsage_localization import _
|
||||||
from ...utils.ytsage_config_manager import ConfigManager
|
from ...utils.ytsage_config_manager import ConfigManager
|
||||||
|
from ...utils.ytsage_constants import APP_LOG_DIR
|
||||||
|
|
||||||
|
|
||||||
class DownloadSettingsDialog(QDialog):
|
class DownloadSettingsDialog(QDialog):
|
||||||
|
|||||||
Reference in New Issue
Block a user