当前位置: 首页>>代码示例>>C#>>正文


C# ConsoleLogger.Log方法代码示例

本文整理汇总了C#中ConsoleLogger.Log方法的典型用法代码示例。如果您正苦于以下问题:C# ConsoleLogger.Log方法的具体用法?C# ConsoleLogger.Log怎么用?C# ConsoleLogger.Log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConsoleLogger的用法示例。


在下文中一共展示了ConsoleLogger.Log方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

 private static void Main(string[] args)
 {
     var logger = new ConsoleLogger();
     logger.Log("Shipment processor console app start");
     var shipmentProcessor = new ShipmentProcessor(logger);
     while (true) {
         logger.Log("");
         shipmentProcessor.Run();
         Thread.Sleep(5000);
         logger.Log("");
     }
 }
开发者ID:OdCyprusHackathon,项目名称:DroneShipper,代码行数:12,代码来源:Program.cs

示例2: Log_Message

 public void Log_Message() {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     using (System.IO.TextWriter w = new System.IO.StringWriter(sb)) {
         Console.SetOut(w);
         ILogger logger = new ConsoleLogger();
         logger.Log("test message", false);
         Assert.IsTrue(sb.ToString().Contains("test message"));
     }
 }
开发者ID:fcsobel,项目名称:sql-deploy,代码行数:9,代码来源:ConsoleLogger_Tests.cs

示例3: Main

        /// <summary>
        /// The main entry point into the application.
        /// </summary>
        /// <param name="args">The set of arguments passed in on the command line.</param>
        public static void Main(string[] args)
        {
            Options commandLineOptions = new Options(args);
            logger = new ConsoleLogger(commandLineOptions.LoggingLevel);
            if (commandLineOptions.ReserveUrl)
            {
                bool urlReserved = ReserveUrl(commandLineOptions.UrlToReserve, true);
                if (!urlReserved)
                {
                    Environment.ExitCode = 1;
                }
            }
            else
            {
                LogVersionDetails(commandLineOptions);
                userName = commandLineOptions.UserName;
                password = commandLineOptions.Password;
                ignoreRemoteShutdown = commandLineOptions.IgnoreRemoteShutdown;
                httpServer = new RemoteWebDriverServer(commandLineOptions.Port, "wd/hub/", logger);
                httpServer.ShutdownRequested += new EventHandler(OnRemoteServerShutdownRequested);
                bool urlReservationExists = CheckForUrlReservation(commandLineOptions);
                if (urlReservationExists)
                {
                    httpServer.StartListening();
                    logger.Log(string.Format(CultureInfo.InvariantCulture, "Server started. RemoteWebDriver instances connect to http://<this machine name>:{0}/wd/hub/", commandLineOptions.Port), LogLevel.Info);
                    if (!string.IsNullOrEmpty(commandLineOptions.HubLocation))
                    {
                        httpServer.RegisterWithHub(commandLineOptions.HubLocation);
                    }

                    Console.CancelKeyPress += new ConsoleCancelEventHandler(Console_CancelKeyPress);
                    while (continueRunning)
                    {
                        System.Threading.Thread.Sleep(100);
                    }
                }
            }
        }
开发者ID:jimevans,项目名称:strontium,代码行数:42,代码来源:Program.cs


注:本文中的ConsoleLogger.Log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。