static void Main(string[] args) { var fileLogWriter = FileLogWriter.GetInstance(); fileLogWriter._fileName = "log.log"; fileLogWriter.LogWarning("Warning!"); var consoleLogWriter = ConsoleLogWriter.Instance; consoleLogWriter.LogInfo("Information."); var multipleLogWriter = new MultipleLogWriter( ConsoleLogWriter.Instance, ConsoleLogWriter.Instance, FileLogWriter.GetInstance() ); multipleLogWriter.LogError("Some Error!"); Console.ReadKey(); }
static void Main(string[] args) { var fileLogWriter = new FileLogWriter("log1.log"); fileLogWriter.LogWarning("Warning!"); var consoleLogWriter = new ConsoleLogWriter(); consoleLogWriter.LogInfo("Information."); var multipleLogWriter = new MultipleLogWriter( new ConsoleLogWriter(), new ConsoleLogWriter(), new ConsoleLogWriter(), new ConsoleLogWriter(), new FileLogWriter("log1.log"), new FileLogWriter("log2.log") ); multipleLogWriter.LogError("Some Error!"); Console.ReadKey(); }
public static FileLogWriter GetInstance() { return(instance ?? (instance = new FileLogWriter())); }