nebula-logger-testing-your-code

nebula-logger-testing-your-code is a skill for Claude Code, Codex from jongpie/NebulaLogger. It costs 104 tokens per session (2,558 once invoked), scanned A, original, MIT.

A testing guide for Apex and Lightning Web Components (LWC), Salesforce code that uses Nebula Logger to record messages such as errors and warnings. It explains how to check log entries held temporarily in memory and, when needed, saved as Salesforce records.

In plain words
What is it for?
Use it to test that code creates the expected log entries, controls logging levels during tests, and keeps Nebula Logger data isolated between tests.
Why use it?
It helps tests verify logging without depending on leftover database records or requiring every test to save logs permanently. Tests can inspect, save, or discard the temporary log entries.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jongpie/nebulalogger/nebula-logger-testing-your-code
Any agent
npx skills add jongpie/NebulaLogger --skill nebula-logger-testing-your-code
Clone the repo
git clone --depth 1 https://github.com/jongpie/NebulaLogger

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for nebula-logger-testing-your-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/jongpie/nebulalogger/nebula-logger-testing-your-code.svg)](https://agentmods.dev/skills/jongpie/nebulalogger/nebula-logger-testing-your-code)
Your own site
<a href="https://agentmods.dev/skills/jongpie/nebulalogger/nebula-logger-testing-your-code"><img src="https://agentmods.dev/badge/skills/jongpie/nebulalogger/nebula-logger-testing-your-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,558 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00104 $0.02558
Opus 5 $0.00052 $0.01279
Sonnet 5 $0.00021 $0.00512
Haiku 4.5 $0.00010 $0.00256

Measured 4d ago against content hash 971e123a38cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nebula-logger-testing-your-code 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 4d 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.

skills/nebula-logger-testing-your-code/SKILL.md · 184 lines

How it starts

The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Code That Uses Nebula Logger

This skill is for developers whose own Apex or LWC code calls Logger.info(...), Logger.error(...), etc. and who want to prove in tests that the right things get logged. It only uses global Nebula Logger APIs, so the same techniques work whether the org has the unlocked or the managed package installed.

The Buffer Model

Nebula Logger buffers log entries in memory during a transaction. Logger.saveLog() moves the buffered entries onto the save path (platform event, queueable, REST, or synchronous DML) - see nebula-logger-instrumentation for the save method choice.

For tests, the buffer is the observation point: you can add entries, inspect the buffer size before saveLog(), then either call saveLog() and query the resulting records, or flushBuffer() to drop them without persisting. All three APIs are global.

Assert on the Buffer Before Save

Logger.getBufferSize() returns the number of entries currently buffered. Use it to prove your code added the entries you expected without needing to persist them.

@IsTest
static void it_should_log_a_warning_when_credit_check_fails() {
  Account account = new Account(Name = 'Test Account');
  insert account;

  System.Test.startTest();
  new CreditCheckService().evaluate(account.Id);
  System.Test.stopTest();

  System.Assert.areEqual(1, Logger.getBufferSize(), 'Expected exactly one entry buffered');
}

Because getBufferSize() runs before saveLog() fires, the assertion works without waiting for the platform event to publish.

Assert on Persisted Records After Save

When you need to assert on the message text, logging level, related record, or scenario, save the log and query the persisted records. The full set of custom objects on the log-management side is:

  • Log__c - one record per logging transaction.
  • LogEntry__c - one record per Logger.info(...) / .error(...) / etc. call.
  • LogEntryTag__c - junction between LogEntry__c and LoggerTag__c when tags are applied.
  • LoggerScenario__c - captures each unique Logger.setScenario(...) value used across transactions.
  • LoggerTag__c - the tag catalog referenced by LogEntryTag__c.

Read the full file on GitHub · 184 lines

Changes

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.

  1. 4d ago First seen · 184 lines · 104 tokens per session scan A 971e123a38cb

Subscribe to this mod's changes

nebula-logger-testing-your-code is a skill published in the GitHub repository jongpie/NebulaLogger (958 stars, last pushed yesterday), licensed MIT. It adds 104 tokens to every session and 2,558 once invoked, about $0.0005 per session on Opus 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.

Related

Other skills, from other repositories

sfcc-performance

Performance optimization strategies for Salesforce B2C Commerce Cloud including caching, efficient data retrieval, index-friendly APIs, and job optimization. Use when asked about SFCC performance, caching strategies, or optimization.

taurgis/sfcc-dev-mcp · 43 tokens

sfcc-localserviceregistry

Guide for creating server-to-server integrations in Salesforce B2C Commerce using LocalServiceRegistry. Use this when asked to integrate external APIs, create HTTP services, implement OAuth flows, or configure service credentials.

taurgis/sfcc-dev-mcp · 48 tokens

sfcc-ocapi-hooks

Guide for implementing OCAPI hooks in Salesforce B2C Commerce. Use this when asked to create OCAPI hooks, extend API endpoints, validate API requests, or modify API responses.

taurgis/sfcc-dev-mcp · 43 tokens

sfcc-scapi-hooks

Guide for implementing SCAPI hooks in Salesforce B2C Commerce. Use this when asked to create SCAPI hooks, extend Shopper API endpoints, validate API requests, or modify API responses for headless commerce.

taurgis/sfcc-dev-mcp · 47 tokens

sfcc-security

Secure coding best practices for Salesforce B2C Commerce Cloud including CSRF protection, authentication, authorization, cryptography, and secrets management. Use when asked about SFCC security, input validation, or secure coding patterns.

taurgis/sfcc-dev-mcp · 47 tokens

sfcc-sfra-scss

Best practices for styling and theming SFRA storefronts using SCSS. Use when asked to create style overrides, theming, responsive layouts, or CSS customizations in SFCC.

taurgis/sfcc-dev-mcp · 44 tokens