public class MemoryLogger { private readonly StringBuilder log = new StringBuilder(); public void Clear() => log.Clear(); public void Info(string message) => log.AppendLine($"{DateTime.Now:u} {message}"); public override string ToString() => log.ToString(); public static implicit operator string(MemoryLogger logger) => logger.ToString(); }
450200cookie-checkC# Simple memory logger