Log

Ambient logging entry point for code with no route to dependency injection — static contexts like LapLogger's startup timing or the handful of places that ran before a service provider exists. Everything else should take ILogger or ILogger{T} through its constructor instead of reaching for this.

Remarks

Engine.Core depends only on Microsoft.Extensions.Logging.Abstractions, never on a concrete backend, so a composition root (Studio, the editor CLI, or a built game's host) must call Configure once at startup. Until then, Logger is a no-op — tests and headless fixtures that never configure logging get a harmless default rather than a null reference.

Properties

Logger

(ILogger) { get; set } = NullLogger.Instance: The ambient logger. A no-op until Configure runs.

Public Methods

Configure

public static void Configure(ILoggerFactory loggerFactory)

Wires the ambient logger to a real backend. Called once, at startup, by whichever composition root owns the process (Studio, the editor CLI, or the built game's host).

Parameters:

  • loggerFactory (ILoggerFactory): The factory the host's logging backend was built with.

Shutdown

public static void Shutdown()

Flushes and disposes the configured backend. A no-op if never configured.