using System; namespace StardewModdingAPI { /// A message queued for log output. public struct LogInfo { /********* ** Accessors *********/ /// The message to log. public string Message { get; set; } /// The log date. public string LogDate { get; set; } /// The log time. public string LogTime { get; set; } /// The message color. public ConsoleColor Colour { get; set; } /// Whether the message should be printed to the console. internal bool PrintConsole { get; set; } /********* ** Public methods *********/ /// Construct an instance. /// The message to log. /// The message color. public LogInfo(string message, ConsoleColor color = ConsoleColor.Gray) { if (string.IsNullOrEmpty(message)) message = "[null]"; this.Message = message; this.LogDate = DateTime.Now.ToString("yyyy-MM-dd"); this.LogTime = DateTime.Now.ToString("HH:mm:ss"); this.Colour = color; this.PrintConsole = true; } } }