// Shared logging helpers for offscreen tracker modules.
// Mirror to service worker console so devs only need one inspector.

export function log(text, detail) {
  console.log(`[Offscreen] ${text}`, detail || "");
  chrome.runtime.sendMessage({ type: "HEADTRACK_LOG", level: "info", text, detail }).catch(() => {});
}

export function errlog(text, detail) {
  console.error(`[Offscreen] ${text}`, detail || "");
  chrome.runtime.sendMessage({ type: "HEADTRACK_LOG", level: "error", text, detail: String(detail || "") }).catch(() => {});
}
