public static ConsoleLogWriter GetInstance() { if (_consoleLogWriter == null) { _consoleLogWriter = new ConsoleLogWriter(); } return(_consoleLogWriter); }
static void Main(string[] args) { MultipeLogWriter multipeLogWriter = MultipeLogWriter.GetInstance( new List <ILogWriter> { ConsoleLogWriter.GetInstance(), FileLogWriter.GetInstance() }); multipeLogWriter.LogError("Ошибка"); multipeLogWriter.LogWarning("Внимание"); multipeLogWriter.LogInfo("Информация"); Console.ReadKey(); }