refactor(abstractions): rename ILogger to IPluginLogger, doc Initialize
Addresses code quality review of ed1c2d0:
- ILogger would collide with Microsoft.Extensions.Logging.ILogger and Serilog.ILogger
in any plugin file that imports both namespaces; renamed to IPluginLogger
- IAcDreamPlugin.Initialize now has an XML doc clarifying its lifecycle contract
This commit is contained in:
parent
ed1c2d061c
commit
9dfbc05052
3 changed files with 9 additions and 4 deletions
|
|
@ -3,7 +3,12 @@ namespace AcDream.Plugin.Abstractions;
|
|||
|
||||
public interface IAcDreamPlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Called exactly once, before <see cref="Enable"/>. The plugin should stash the
|
||||
/// host reference and do any one-time setup that doesn't depend on a connected world.
|
||||
/// </summary>
|
||||
void Initialize(IPluginHost host);
|
||||
|
||||
void Enable();
|
||||
void Disable();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ namespace AcDream.Plugin.Abstractions;
|
|||
|
||||
/// <summary>
|
||||
/// Entry point for a plugin into the acdream runtime. The surface will grow
|
||||
/// across phases as more systems come online. For Phase 1 only ILogger is real.
|
||||
/// across phases as more systems come online. For Phase 1 only IPluginLogger is real.
|
||||
/// </summary>
|
||||
public interface IPluginHost
|
||||
{
|
||||
ILogger Log { get; }
|
||||
IPluginLogger Log { get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// src/AcDream.Plugin.Abstractions/ILogger.cs
|
||||
// src/AcDream.Plugin.Abstractions/IPluginLogger.cs
|
||||
namespace AcDream.Plugin.Abstractions;
|
||||
|
||||
public interface ILogger
|
||||
public interface IPluginLogger
|
||||
{
|
||||
void Info(string message);
|
||||
void Warn(string message);
|
||||
Loading…
Add table
Add a link
Reference in a new issue