static void DoLog() { Console.WriteLine("Doing Log!"); if (_log.IsErrorEnabled) { _log.Error("This is an Error..."); } if (_log.IsDebugEnabled) { for (int i = 0; i < 10; i++) { _log.Debug("This is a simple log!"); } } if (_log.IsErrorEnabled) { _log.Error("This is an Error..."); } if (_log.IsInfoEnabled) { _log.Info("This is an Info..."); } _log.Warn("This is a Warning..."); _log.Fatal("This is a Fatal..."); _log.Error("This is an error with an exception.", new Exception("The message exception here.")); _log.Warn("This is a message on many lines...\nlines...\nlines...\nlines..."); _log.Warn("This is a message on many lines...\r\nlines...\r\nlines...\r\nlines..."); DummyManager dm = new DummyManager(); dm.DoIt(); DummyTester dt = new DummyTester(); dt.DoIt(); }
static void DoLog(string cmd) { Console.WriteLine("\nBegin Doing Log!"); Console.WriteLine(DateTime.Now); if (cmd.ToLower() == "b") { for (int i = 0; i < 1000000; i++) { _log.Info(i); } } if (cmd.ToLower() == "b2") { string data = File.ReadAllText(@"d:\Projects\github\Log2Window\src\TestLog4net\testDatas.txt"); for (int i = 0; i < 100; i++) { _log.Info(i + " " + data); } } else if (cmd.ToLower() == "t") { for (int i = 0; i < 10; i++) { var log = LogManager.GetLogger("Test.Program.t" + i); ThreadPool.QueueUserWorkItem(delegate(object ob) { for (int j = 0; j < 10000; j++) { (ob as ILog).Info(j); } }, log); } } else if (cmd[0] >= '1' && cmd[0] <= '9') { _log.Info(cmd); } else if (cmd.ToLower() == "e") { try { ThrowTestEx(); return; } catch (Exception ex) { _log.Error("TestEx", ex); } } else if (cmd.ToLower() == "c") { for (int i = 0; i < 10; i++) { _log.Info("▓Р╩нол╬─"); } } else { if (_log.IsErrorEnabled) { _log.Error("This is an Error..."); } if (_log.IsDebugEnabled) { for (int i = 0; i < 10; i++) { _log.Debug("This is a simple log!"); } } if (_log.IsErrorEnabled) { _log.Error("This is an Error..."); } if (_log.IsInfoEnabled) { _log.Info("This is an Info..."); } _log.Warn("This is a Warning..."); _log.Fatal("This is a Fatal..."); _log.Error("This is an error with an exception.", new Exception("The message exception here.")); _log.Warn("This is a message on many lines...\nlines...\nlines...\nlines..."); _log.Warn("This is a message on many lines...\r\nlines...\r\nlines...\r\nlines..."); DummyManager dm = new DummyManager(); dm.DoIt(); DummyTester dt = new DummyTester(); dt.DoIt(); } Console.WriteLine("End Doing Log!"); }
static void DoLog(char keyChar) { Console.WriteLine("\nBegin Doing Log!"); Console.WriteLine(DateTime.Now); if (Char.ToLower(keyChar) == 'b') { for (int i = 0; i < 1000000; i++) { _log.Info(i); } } else if (Char.ToLower(keyChar) == 't') { for (int i = 0; i < 10; i++) { var log = LogManager.GetLogger("Test.Program.t" + i); ThreadPool.QueueUserWorkItem(delegate(object ob) { for (int j = 0; j < 10000; j++) { (ob as ILog).Info(j); } }, log); } } else if (keyChar >= '1' && keyChar <= '9') { _log.Info(keyChar); } else if (Char.ToLower(keyChar) == 'e') { try { ThrowTestEx(); return; } catch (Exception ex) { _log.Error("TestEx", ex); } } else if (Char.ToLower(keyChar) == 'c') { for (int i = 0; i < 10; i++) { _log.Info("▓Р╩нол╬─"); } } else { if (_log.IsErrorEnabled) { _log.Error("This is an Error..."); } if (_log.IsDebugEnabled) { for (int i = 0; i < 10; i++) { _log.Debug("This is a simple log!"); } } if (_log.IsErrorEnabled) { _log.Error("This is an Error..."); } if (_log.IsInfoEnabled) { _log.Info("This is an Info..."); } _log.Warn("This is a Warning..."); _log.Fatal("This is a Fatal..."); _log.Error("This is an error with an exception.", new Exception("The message exception here.")); _log.Warn("This is a message on many lines...\nlines...\nlines...\nlines..."); _log.Warn("This is a message on many lines...\r\nlines...\r\nlines...\r\nlines..."); DummyManager dm = new DummyManager(); dm.DoIt(); DummyTester dt = new DummyTester(); dt.DoIt(); } Console.WriteLine("End Doing Log!"); }