Skip to content

Logging

Nill edited this page Sep 10, 2021 · 1 revision

For all intents and purposes, Telefrag uses the Microsoft ILogger standard abstraction.

ILoggable

Objects in Telefrag worthy of logging things implement ILoggable which exposes a single ILogger Logger { get; } property.

There are also a number of extension methods available for ILoggable objects:

  • Log(level, message)
  • LogInfo(message)
  • LogWarning(message)
  • LogError(message)
  • LogDebug(message)
  • LogTrace(message)
  • LogException(exception, message)

Logger

Telefrag provides an implementation of ILogger at Telefrag.Logging.Logger and is registered as the default logger in the DI system.

Currently all this class does is write the events to the console output but is planned to be much more configurable in the future; in the interim you can implement anything else using ILogger from NuGet (or build your own!)

Clone this wiki locally