using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Amazon.Lambda.Core;
namespace Amazon.Lambda.TestUtilities
{
///
/// An implementation if ILambdaLogger that stores all the messages in a buffer and writes the messages to the console.
///
public class TestLambdaLogger : ILambdaLogger
{
///
/// Buffer for all the log messages written to the logger.
///
public StringBuilder Buffer { get; } = new StringBuilder();
///
/// Write log messages to the console and the Buffer without appending a newline terminator.
///
///
public void Log(string message)
{
Buffer.Append(message);
Console.Write(message);
}
///
/// Write log messages to the console and the Buffer with a newline terminator.
///
///
public void LogLine(string message)
{
Buffer.AppendLine(message);
Console.WriteLine(message);
}
}
}