Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var filelogwriter = FileLogWriter.Instance;

            filelogwriter.LogInfo("Message containing information");
            filelogwriter.LogWarning("Message containing warning");
            filelogwriter.LogError("Message containing error");

            var consolelogwriter = ConsoleLogWriter.Instance;

            consolelogwriter.LogInfo("Message containing information");
            consolelogwriter.LogWarning("Message containing warning");
            consolelogwriter.LogError("Message containing error");

            var miltipleogriter = MultipleLogWriter.Instance(consolelogwriter, filelogwriter);

            miltipleogriter.LogInfo("Message containing information");
            miltipleogriter.LogWarning("Message containing warning");
            miltipleogriter.LogError("Message containing error");

            Console.ReadKey();
        }
Exemplo n.º 2
0
 public static MultipleLogWriter Instance(params ILogWriter[] _logwriters)
 {
     return(_instance ??
            (_instance = new MultipleLogWriter(_logwriters)));
 }