using OpenTelemetry;
using OpenTelemetry.Logs;
namespace BlueLaminate.Cli.Logging;
///
/// Minimal console sink for the OpenTelemetry log pipeline: one line per record
/// as "{utc timestamp} {message}". Requires IncludeFormattedMessage so the
/// message arrives with its template arguments already substituted.
///
public sealed class CompactConsoleLogExporter : BaseExporter
{
public override ExportResult Export(in Batch batch)
{
foreach (var record in batch)
{
var message = record.FormattedMessage ?? record.Body ?? string.Empty;
Console.WriteLine($"[{record.Timestamp:yyyy-MM-dd HH:mm:ss.fff'Z'}] {message}");
}
return ExportResult.Success;
}
}