コード例 #1
0
        public static void Main()
        {
#if DEBUG
            LogManager.LogFactory = new ConsoleLogFactory();
#else
            LogManager.LogFactory = new NLogFactory();
#endif
            var logger = LogManager.GetLogger(typeof(ServiceStartup));

            try
            {
                var insteonConnection = ConfigurationManager.AppSettings["insteonConnection"];

                appHost = new InsteonAppListenerHost(insteonConnection);

                appHost.Init();
                appHost.Start(ListeningOn);
                logger.InfoFormat("Listening On: {0}", ListeningOn);
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("{0}: {1}", ex.GetType().Name, ex.Message);
                throw;
            }
        }
コード例 #2
0
        public static void Main()
        {
#if DEBUG
            LogManager.LogFactory = new ConsoleLogFactory();
#else
            LogManager.LogFactory = new NLogFactory();
#endif
            var logger = LogManager.GetLogger(typeof(ServiceStartup));

            try
            {
                var insteonConnection = ConfigurationManager.AppSettings["insteonConnection"];

                appHost = new InsteonAppListenerHost(insteonConnection);

                appHost.Init();
                appHost.Start(ListeningOn);
                logger.InfoFormat("Listening On: {0}", ListeningOn);
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("{0}: {1}", ex.GetType().Name, ex.Message);
                throw;
            }
        }