@briklab/lib/warner
Structured warning collection and reporting for BrikLab modules with configurable protection levels.
Use summary Mode in CI
The summary mode keeps logs concise while still tracking warning totals.
API
- Classes:
Warner - Types:
ProtectionLevel,WarningLevel,Warning,WarnerOptions - Functions:
createWarner - Constants:
warner
Quick Start
ts
import { Warner } from "@briklab/lib/warner";
const warner = new Warner({
level: "summary",
protectionLevel: "boundary",
packageName: "MyPackage"
});
warner.warn({
message: "This is a warning",
source: "config-loader",
hint: "Set `strict: true` for better diagnostics."
});
warner.finalize();Behavior Modes
- silent: Collect warnings without printing
- summary: Print total warnings on finalize/flush
- full: Print warning details as configured
Diagram
Live Demo
Recommended to test it in your browser. The test here might not work properly
Console
No logs yet.
