using HStation.RevitDev.RevitDataExport.Common; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HStation.RevitDev.RevitDataExport.Common { public class Log : Singleton { private string LogPath = string.Empty; public void SetLogPath(string path) { LogPath = path; } public void WriteError(string message) { DateTime now = DateTime.Now; var prefix = $@"{now.ToString("yy-MM-dd HH:mm:ss.fff")} Error:"; File.AppendAllText(LogPath, prefix + message + "\n"); } public void WriteInfo(string message) { DateTime now = DateTime.Now; var prefix = $@"{now.ToString("yy-MM-dd HH:mm:ss.fff")} Info:"; File.AppendAllText(LogPath, prefix + message + "\n"); } } }