using System; using System.IO; using Vintagestory.API.Common; namespace ShardProcessor { public class LogAdaptor : LoggerBase { private StreamWriter fileOutput; public LogAdaptor( ) { fileOutput = File.CreateText("SP_Log.txt"); fileOutput.AutoFlush = true; } protected override void LogImpl(EnumLogType logType, string format, params object[ ] args) { string formatedText = null; if (args != null && args.Length > 0) { formatedText = string.Format(format, args); } else { formatedText = format; } fileOutput.WriteLine($"«{logType}» {formatedText}"); } ~LogAdaptor( ) { fileOutput.Flush( ); fileOutput.Close( ); } } }