.claude/skills/log-module/SKILL.md
LogModule reference — centralized logging with levels, categories, reactive stream, history buffer, and production stripping. Use when working with logging, diagnostics, or debug output.
npx skillsauth add punkfuncgames/tetris-clone .claude/skills/log-moduleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Centralized logging service replacing all direct Debug.Log usage. Provides log levels, category tags, reactive log stream, configurable minimum level, and ring-buffer history.
Package: com.punkfuncgames.log | Define: PUNKFUNC_LOG
Packages/com.punkfuncgames.log/Runtime/PunkFuncGames.Log/
├── Model/LogLevel.cs # Log level enum (Trace→Off)
├── Model/LogEntry.cs # Immutable log entry struct
├── Config/LogSettings.cs # ScriptableObject configuration
├── Service/ILogService.cs # Public interface
├── Service/LogService.cs # Implementation
└── Installer/LogInstaller.cs # VContainer installer
Trace(0) < Debug(1) < Info(2) < Warning(3) < Error(4) < Fatal(5) < Off(6)
MinimumLevel are suppressedTrace/Debug stripped in release builds via #if !UNITY_EDITOR && !DEVELOPMENT_BUILDpublic readonly LogLevel Level;
public readonly string Category;
public readonly string Message;
public readonly DateTime Timestamp;
public interface ILogService : IService
{
ReadOnlyReactiveProperty<LogLevel> MinimumLevel { get; }
Observable<LogEntry> LogStream { get; }
IReadOnlyList<LogEntry> History { get; }
void SetMinimumLevel(LogLevel level);
void Trace(string category, string message);
void Debug(string category, string message);
void Info(string category, string message);
void Warning(string category, string message);
void Error(string category, string message);
void Fatal(string category, string message);
void Log(LogLevel level, string category, string message);
}
Thin wrapper: public LogSettingsData data;
Access fields via _settings.data.fieldName.
LogSettingsData ([Serializable] public struct, camelCase fields):
minimumLevel: LogLevel (default: Debug)
historyCapacity: int (default: 256)
enableTimestamps: bool (default: true)
enableCategoryPrefix: bool (default: true)
timestampFormat: string (default: "HH:mm:ss.fff")
// In ProjectLifetimeScope — registered FIRST before all other modules
LogInstaller.Install(builder, _logSettings);
public class MyService : IMyService
{
private const string LOG_CATEGORY = "MyModule";
private readonly ILogService _logService;
public MyService(ILogService logService)
{
_logService = logService;
}
public void DoWork()
{
_logService.Info(LOG_CATEGORY, "Starting work...");
_logService.Debug(LOG_CATEGORY, $"Processing {count} items");
}
}
public class MyView : MonoBehaviour
{
private ILogService _logService;
[Inject]
public void Construct(ILogService logService = null)
{
_logService = logService;
}
private void OnError(string msg)
{
_logService?.Error("UI", msg);
}
}
public class MyUtility
{
private readonly ILogService _logService;
public MyUtility(ILogService logService = null)
{
_logService = logService;
}
private void OnProblem(string msg)
{
_logService?.Warning("Utility", msg); // null-safe
}
}
_logService.LogStream
.Where(e => e.Level >= LogLevel.Warning)
.Subscribe(entry => debugUI.AddEntry(entry))
.AddTo(_disposables);
foreach (LogEntry entry in _logService.History)
{
console.AppendLine($"[{entry.Level}] [{entry.Category}] {entry.Message}");
}
| Category | Used By |
|----------|---------|
| "Bootstrap" | BootstrapOrchestrator, all bootstrap phases |
| "Save" | SaveMigrator, BinarySerializer, AesEncryption |
| "Pool" | PoolService |
| "Wallet" | WalletService |
| "Stats" | StatsService |
| "Time" | TimeService |
| "FloatingText" | FloatingTextService |
| "Localization" | LocalizedImage, LocalizedAudio |
| LogLevel | Unity Method |
|----------|-------------|
| Trace, Debug, Info | Debug.Log() |
| Warning | Debug.LogWarning() |
| Error, Fatal | Debug.LogError() |
MockFactory.CreateLogService(LogLevel minimumLevel = LogLevel.Trace) — NSubstitute mockTestFixtures.CreateLogSettings(...) — ScriptableObject fixture with data struct initializedPackages/com.punkfuncgames.log/Tests/EditMode/LogServiceTests.csdevelopment
WalletModule reference — currency management with BigDouble support, reactive properties, caps, lifetime stats, and persistence. Use when working with currencies, wallets, or financial systems.
development
UnlockConditionModule reference — composable unlock conditions using ScriptableObjects with AND/OR/NOT logic, stat/currency/upgrade/prestige/gamestate/boolean checks, reactive service layer with progress tracking. Use when implementing unlock systems, gating, or progression requirements.
development
UndoModule reference — command pattern with undo/redo stacks, command merging, and reactive state. Use when implementing undo/redo, undoable actions, or command patterns.
tools
Unity UI Toolkit reference — UXML documents, USS styling, MVVM pattern (ViewModel + Presenter), custom VisualElements, responsive layout, animations, performance guidelines, and complete Figma-to-UI-Toolkit property mapping. Use when building or modifying UI with UI Toolkit, creating UXML/USS files, writing ViewModels or Presenters, designing screens/panels/components, or converting Figma designs to UI Toolkit.