using EonaCat.LogStack.Core;

namespace EonaCat.LogStack.Boosters;

/// <summary>
/// Adds a log schema version to make future log format migrations easier.
/// </summary>
public sealed class SchemaVersionBooster : BoosterBase
{
    private readonly string _version;

    public SchemaVersionBooster(string version = "1.0")
        : base("SchemaVersion")
    {
        _version = version;
    }

    public override bool Boost(ref LogEventBuilder builder)
    {
        builder.WithProperty("log_schema_version", _version);
        return true;
    }
}
