Borrowing it
Nothing to install: this file belongs to mergesort/Broadcast. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/mergesort/Broadcast/main/.agents/skills/broadcast-logging-best-practices/SKILL.mdgit clone --depth 1 https://github.com/mergesort/BroadcastWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mergesort/broadcast/broadcast-logging-best-practices)<a href="https://agentmods.dev/skills/mergesort/broadcast/broadcast-logging-best-practices"><img src="https://agentmods.dev/badge/skills/mergesort/broadcast/broadcast-logging-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/mergesort/broadcast/broadcast-logging-best-practices"><img src="https://agentmods.dev/badge/skills/mergesort/broadcast/broadcast-logging-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Privilege Escalation · line 390 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.04697 |
| Opus 5.5 | $0.00021 | $0.01879 |
| Sonnet 5.5 | $0.00010 | $0.00939 |
| Haiku 4.5 | $0.00005 | $0.00470 |
Grade A, and why
broadcast-logging-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 498 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Broadcast Logging Best Practices
Use this skill when integrating Broadcast into a Swift project. Treat Broadcast as an external reusable logging library; do not assume you are modifying Broadcast itself unless the user explicitly asks to work on the library.
Before making non-trivial Broadcast changes or integrations, read the current Broadcast README and relevant DocC articles in Sources/Broadcast/Documentation.docc/ so examples, API choices, and terminology match the library's public guidance.
Integration Workflow
- Add Broadcast as a dependency using the host project's normal package workflow.
- Import
Broadcastwhere logging is configured or called. - Create a shared
Loginstance from one or more destinations. - For app or app-specific package code, prefer one immutable app or package-scoped global
let logso SwiftUI and non-SwiftUI surfaces share the same destination graph. - Use Broadcast's built-in
Log.Payloadhelper factories for common typed values, then add app-specificLog.Categoryvalues and app-specificLog.Payloadhelpers in the integrating app or app-specific logging package. - Replace important free-form logs with structured logs where they help explain user-visible behavior, support diagnostics, startup, sync, entitlement, routing, persistence, or network decisions.
- Validate with the host project's normal build and test commands.
Core APIs
Logfans out one log call to one or more destinations.LoggingDestinationis the write-only sink protocol whose primitive islog(_ record:); Broadcast provides defaultdebug,info,warn,error, andfaultconvenience methods that create records.BufferedLoggingDestinationextendsLoggingDestinationwithrecords()for destinations that need access to canonical records, plus overridable defaultlogs()text export.ConsoleLoggerwrites process-local output through Apple's unified logging system and is available only on Apple platforms.SessionLoggerbuffers logs in memory for the current process.MultiSessionLoggerbuffers canonicalLog.Recordvalues across launches when Broadcast's defaultMultiSessionLoggingpackage trait is enabled. It currently uses Boutique on Apple platforms; use it only when the host app has configured the required persistence.SwiftLogDestinationforwards Broadcast records into apple/swift-log when Broadcast is built with theSwiftLoggingpackage trait. Use it when Broadcast should remain the call-site API but an app or server also needs records delivered to a configured swift-log backend.Log.Signaldescribes the intent of a structured log. Defaults include.action,.state,.event,.metric, and.diagnostic.Log.Categorydescribes a human-readable subsystem or area.Log.Payloadstores typed key-value diagnostics and exposes public typed initializers plus helper factories such as.string,.bool,.int,.uuid,.url,.date,.duration,.error,.count,.id, and.timestampso call-sites do not need to format values manually.Log.Recordis the identifiable timestamped semantic structured log value that destinations format throughrecordFormatter, which defaults to Broadcast's standard single-line format; records create a UUID and current timestamp by default.Log.Record.Formatteris the type-erased destination-level formatter for structuredLog.Recordvalues.- Built-in
Log.Recordformat styles include.default,.json,.tokenOptimized, and.canonicalLogLine. Log.DateProvidersupplies dates for buffered loggers, andLog.Timestamp.FormatStyleformats those dates;Log.Timestampdefaults to the current date and is available asLog.Timestamp.now, but fixed date providers are still the deterministic-test path for logger output.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 20d ago Changed · +28 lines 1cef4165f1c7
- 2mo ago First seen · 470 lines · 52 tokens per session scan A b6006b3e5815
broadcast-logging-best-practices is a skill published in the GitHub repository mergesort/Broadcast (50 stars, last pushed 20d ago), licensed MIT. It adds 52 tokens to every session and 4,697 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
broadcast-logging-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| broadcast-logging-best-practicesmergesort/Broadcast | Skill | 50 | 20d ago | MIT | A | 52 | Claude Code, Codex |
| swift-format-stylen0an/Swift-FormatStyle-Agent-Skill | Skill | 15 | 1mo ago | MIT | A | 50 | Claude Code, Codex |
| authoring-java-sdk-tasksastronomer/agents | Skill | 458 | 4d ago | Apache-2.0 | A | 152 | Claude Code |
| swift-concurrencyAvdLee/Swift-Concurrency-Agent-Skill | Skill | 1.7k | 1mo ago | MIT | A | 56 | Claude Code, Codex |
| swift-developmentsammcj/agentic-coding | Skill | 168 | 2d ago | Apache-2.0 | A | 13 | Claude Code, Codex |
| android-developmenttravisjneuman/.claude | Skill | 107 | yesterday | MIT | A | 33 | Claude Code, Codex |
| ios-developmenttravisjneuman/.claude | Skill | 107 | yesterday | MIT | A | 43 | Claude Code, Codex |