Files
rouggy 7ace2cc602 Initial codebase: Go + Wails amateur radio logbook
Backend (Go 1.25 / Wails v2):
- QSO storage on SQLite (modernc) with embedded migrations (0001..0005)
- Streaming ADIF import (batch insert) + WorkedBefore per callsign and DXCC
- Callsign lookup with QRZ.com + HamQTH providers (primary/failsafe routing)
  and SQLite-backed TTL cache
- DXCC resolver from cty.dat (auto-download, longest-prefix-match)
- Multi-profile operator identities (home/portable/SOTA/contest) — every
  QSO stamps MY_* from the active profile
- CAT control via OmniRig COM on a single OS-locked goroutine, with
  bidirectional sync (freq/mode/band/split/VFOs) and Rig1/Rig2 hot-swap
- Settings store (key/value), CAT debug log at %APPDATA%/HamLog/cat.log

Frontend (React 18 + TypeScript + Tailwind v4 + shadcn-style):
- Single-row entry strip with CAT-aware band/mode/freq, RST, Start/End
  UTC, per-field locks (band/mode/freq/start/end) for backdated QSOs
- Topbar: live freq (MHz.kHz.Hz dotted), live UTC, band/mode/SPLIT badges,
  CAT pill with rig selector and clickable Azimuth pill (rotor TODO)
- Settings tree: Profiles (Log4OM-style manager), Station Information
  (edits the active profile), unified Callsign Lookup with Test buttons,
  Bands/Modes lists, CAT
- Worked-before matrix (band × mode × class) with new-DXCC highlighting
- ADIF import from menu + Maintenance > Refresh cty.dat

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 00:16:45 +02:00

43 lines
1.1 KiB
Go

package cat
import (
"log"
"os"
"path/filepath"
)
// debugLog writes CAT debug events to %APPDATA%/HamLog/cat.log so users can
// diagnose mode/freq mismatches without rebuilding with -windowsconsole.
//
// Initialised lazily on first use. Falls back to the standard library
// default logger (stderr, usually invisible in a Wails GUI build) if the
// log file can't be opened.
var debugLog = openDebugLog()
func openDebugLog() *log.Logger {
base, err := os.UserConfigDir()
if err != nil {
return log.Default()
}
dir := filepath.Join(base, "HamLog")
if err := os.MkdirAll(dir, 0o755); err != nil {
return log.Default()
}
f, err := os.OpenFile(filepath.Join(dir, "cat.log"),
os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
if err != nil {
return log.Default()
}
return log.New(f, "", log.LstdFlags|log.Lmicroseconds)
}
// DebugLogPath returns the path the cat.log file would be opened at, for
// surfacing in the UI / docs.
func DebugLogPath() string {
base, err := os.UserConfigDir()
if err != nil {
return ""
}
return filepath.Join(base, "HamLog", "cat.log")
}