コード例 #1
0
        static void Main(string[] args)
        {
            var consoleLogWriter  = new ConsoleLogWriter();
            var fileLogWriter     = new FileLogWriter();
            var multipleLogWriter = new MultipleLogWriter(consoleLogWriter, fileLogWriter);

            multipleLogWriter.LogError("Some error");
            multipleLogWriter.LogWarning("Some warning");
            multipleLogWriter.LogInfo("Some info");
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: CrlnProgramming/qw
        static void Main(string[] args)
        {
            var consoleLogWriter  = new ConsoleLogWriter();
            var fileLogWriter     = new FileLogWriter();
            var multipleLogWriter = new MultipleLogWriter(new ILogerWriter[] { consoleLogWriter, fileLogWriter });

            consoleLogWriter.LogInfo("LogInfo");
            consoleLogWriter.LogWarning("LogWarning");
            consoleLogWriter.LogError("LogError");

            fileLogWriter.LogInfo("LogInfo");
            fileLogWriter.LogWarning("LogWarning");
            fileLogWriter.LogError("LogError");
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: k080197/nodrdic-it-cs-q1
        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();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: k080197/nodrdic-it-cs-q1
        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();
        }