Skip to content

catalog: replace NullLogger with proper ILogger injection in production DI paths #26

Description

@CCoupel

Context

`NullLogger.Instance` is used in `ConfigController` when constructing `SyncService` and `LibraryProvisioner`. This means sync operations produce no logs in production, making debugging difficult for end users.

Problem

`ILoggerFactory` is not registered in Emby's DI container, which prevented injecting it directly into `ConfigController`. As a workaround, `NullLogger.Instance` was used.

Fix

Investigate the correct way to obtain a typed `ILogger` within an Emby plugin controller. Options:

  1. Inject `ILogger` and `ILogger` directly (check if registered by Emby)
  2. Register these loggers manually in `Plugin.cs` or a service registration hook
  3. Use `Plugin.Logger` (base class property) and pass it down

Impact

Without real logging, failures in manual syncs triggered from the UI are silent — users see "0 items failed" with no log entries.

Priority

Medium — Affects debuggability but does not block catalog submission.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions