Skip to content

Commit 8ff68ef

Browse files
author
Ming Ying
committed
Display log location in Settings window.
1 parent fff6036 commit 8ff68ef

2 files changed

Lines changed: 13 additions & 17 deletions

File tree

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tested. MacLoggerDX may also work, except changing modes on SDR is not supported
3737

3838
## Settings
3939

40-
To change settings, click the "Setting" button on the main window.
40+
To change settings, click the "Settings" button on the main window.
4141

4242
![Settings](resources/settings.png "Settings")
4343

@@ -87,17 +87,7 @@ Increase this number if you notice your computer is not very responsive. It is n
8787

8888
## Logging
8989

90-
Cat-Relay writes rotating log files named `cat-relay.log`. The directory is computed with [platformdirs](https://pypi.org/project/platformdirs/) as `user_log_dir("cat-relay", "N2IW")` (app name **cat-relay**, author **N2IW**).
91-
92-
Typical full paths:
93-
94-
- **macOS**: `~/Library/Logs/cat-relay/cat-relay.log`
95-
- **Windows**: `%LOCALAPPDATA%\N2IW\cat-relay\Logs\cat-relay.log` (for example under `C:\Users\<you>\AppData\Local\`)
96-
- **Linux**: `~/.local/state/cat-relay/log/cat-relay.log` (or under `$XDG_STATE_HOME` when that variable is set)
97-
98-
When a log file grows large it is rotated; you may also see `cat-relay.log.1`, `cat-relay.log.2`, and so on in the same folder.
99-
100-
Messages are logged to this file and, when standard output is available (for example when you run from a terminal), to the console as well. If you report an issue, attaching the current `cat-relay.log` helps with diagnosis.
90+
Cat-Relay writes rotating log files named `cat-relay.log`. Messages are logged to this file and, when standard output is available (for example when you run from a terminal), to the console as well. If you report an issue, attaching the current `cat-relay.log` helps with diagnosis. Location of the logs is displayed on the bottom of the Settings window.
10191

10292
## Run from source code
10393

settings.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
import logging
33

44
from PySide6.QtCore import Slot
5-
from PySide6.QtWidgets import QVBoxLayout, QDialog, QDialogButtonBox
5+
from PySide6.QtWidgets import QVBoxLayout, QDialog, QDialogButtonBox, QLabel, QLineEdit
66

77
from gui_components.dropdown import Dropdown
88
from gui_components.text_input import TextInput, INTEGER
99
from gui_components.seconds_input import DecimalSecondsInput, WholeSecondsInput
1010
from config import VALID_CAT_SOFTWARES, PLACEHOLDER_SOFTWARE, VALID_SDRS, SDR_PP, N1MM, VALID_LOCATIONS, LOCAL, NETWORK
11+
from utils.log_config import LOG_DIR
1112

1213
logger = logging.getLogger(__name__)
1314

@@ -21,9 +22,9 @@ def __init__(self, params, parent=None):
2122

2223
# Set up UI
2324
self.parent_window = parent
24-
self.radio_info_widget = None
25-
self.sdr_ip_widget = None
26-
self.cat_ip_widget = None
25+
self.radio_info_widget: TextInput
26+
self.sdr_ip_widget: TextInput
27+
self.cat_ip_widget: TextInput
2728
self.setWindowTitle("Settings")
2829
self.setLayout(self.create_layout())
2930

@@ -66,6 +67,11 @@ def create_layout(self):
6667
# Sync time
6768
layout.addWidget(DecimalSecondsInput('Sync Interval', self.params.sync_interval, 0.05, 5, 0.01, lambda time: self.params.set_sync_interval(time)))
6869

70+
layout.addWidget(QLabel('Logs can be found at:'))
71+
log_files_line = QLineEdit(str(LOG_DIR))
72+
log_files_line.setReadOnly(True)
73+
layout.addWidget(log_files_line)
74+
6975
# Action Buttons
7076
button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
7177
button_box.accepted.connect(self.accept)
@@ -90,7 +96,7 @@ def cat_software_changed(self, software):
9096
self.radio_info_widget.set_visibility(software == N1MM)
9197

9298
def accept(self):
93-
if hasattr(self.parent_window, "update_params"):
99+
if self.parent_window and hasattr(self.parent_window, "update_params"):
94100
if self.params.cat_software == PLACEHOLDER_SOFTWARE:
95101
logger.warning('Please select a CAT Software')
96102
return

0 commit comments

Comments
 (0)