diff --git a/CLAUDE.md b/CLAUDE.md index 5bae96f..ba598be 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,7 +43,7 @@ dotnet test src/EggEncoder.UnitTests/EggEncoder.UnitTests.csproj --configuration - **`Native/`** — `FlacNative.cs`/`Mp3Native.cs` (`[LibraryImport]` P/Invoke declarations), `NativeLibraryLoader.cs` (a `[ModuleInitializer]` that registers a custom `DllImportResolver` so `libFLAC`/`libmp3lame` load from `Native/win-x64/` relative to `AppContext.BaseDirectory` regardless of the consuming app's working directory) - **`Waveform/WaveformCalculator.cs`** — streaming peak-window calculator fed blocks during decode, used by every codec's probe path to produce `ProbeResult.Waveform` - **`Results/ProbeResult.cs`** — the public `ProbeResult` DTO returned by every `Probe` call -- **`ServiceCollectionExtensions.cs`** — `AddEggEncoder()` DI registration; no options, registers `IMediaEncoder` → `NativeEncoder` (scoped) +- **`ServiceCollectionExtensions.cs`** — `AddEggEncoder(enableLogging: true)` DI registration; registers `IMediaEncoder` → `NativeEncoder` (scoped). `enableLogging: false` fully silences `NativeEncoder`'s start/completion/failure logs ### Native binary packaging diff --git a/docs/Configuration.html b/docs/Configuration.html index 8588298..71b50ff 100644 --- a/docs/Configuration.html +++ b/docs/Configuration.html @@ -4,7 +4,7 @@
EggEncoder is fully native and has no options to set. AddEggEncoder() takes no parameters:
builder.Services.AddEggEncoder();
+ EggEncoder is fully native and has one optional setting: whether it logs. AddEggEncoder() takes an optional enableLogging parameter (default true):
builder.Services.AddEggEncoder(); // logs via ILogger<NativeEncoder> (default)
+builder.Services.AddEggEncoder(enableLogging: false); // fully silent
This registers IMediaEncoder → NativeEncoder (scoped). There's no engine to pick, no binary path to provide, and nothing that can fail to resolve at startup due to missing external tooling.
Every Probe/ConvertFile/CutFile call logs a start and a completion message at LogInformation, and logs (then rethrows) any failure at LogError — set enableLogging: false to suppress all of it, or leave it on and control verbosity the standard way via your app's logging configuration (e.g. "Logging:LogLevel:EggEncoder.NativeEncoder": "None" in appsettings.json).
The bundled libmp3lame.dll and libFLAC.dll are located automatically at runtime by NativeLibraryLoader, relative to AppContext.BaseDirectory — this is not configurable and requires no setup. See Native Binary Packaging for how the files get there.
services.AddEggEncoder() registers exactly one service: IMediaEncoder → NativeEncoder (scoped). Inject it into a controller, a scoped service, or resolve it from an IServiceScope in a background worker.
services.AddEggEncoder() registers exactly one service: IMediaEncoder → NativeEncoder (scoped). Inject it into a controller, a scoped service, or resolve it from an IServiceScope in a background worker. Pass AddEggEncoder(enableLogging: false) to silence NativeEncoder's logging entirely — see Configuration.
// Program.cs
diff --git a/docs/index.html b/docs/index.html
index 040325d..54be6e2 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -122,7 +122,7 @@ Key Features
One-Line DI
- services.AddEggEncoder() registers IMediaEncoder — no options, no config required.
+ services.AddEggEncoder() registers IMediaEncoder — no config required, one optional flag to silence logging.