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


C# ILog.Debug方法代码示例

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


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

示例1: Application_Startup

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                String log4net = String.Format(BogheApp.Properties.Resources.log4net_xml, Win32ServiceManager.SharedManager.ApplicationDataPath);
                using (Stream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(log4net)))
                {
                    XmlConfigurator.Configure(stream);
                    LOG = LogManager.GetLogger(typeof(App));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                this.Shutdown();
            }

            LOG.Debug("====================================================");
            LOG.Debug(String.Format("======Starting Boghe - IMS/RCS Client v{0} ====", System.Reflection.Assembly.GetEntryAssembly().GetName().Version));
            LOG.Debug("====================================================");

            if (!Win32ServiceManager.SharedManager.Start())
            {
                MessageBox.Show("Failed to start service manager");
                this.Shutdown();
            }
        }
开发者ID:xolile,项目名称:boghe,代码行数:27,代码来源:App.xaml.cs

示例2: Application_Startup

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                String log4net = String.Format(BogheApp.Properties.Resources.log4net_xml, Win32ServiceManager.SharedManager.ApplicationDataPath);
                using (Stream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(log4net)))
                {
                    XmlConfigurator.Configure(stream);
                    LOG = LogManager.GetLogger(typeof(App));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                this.Shutdown();
            }

            LOG.Debug("====================================================");
            LOG.Debug(String.Format("======Starting Boghe - IMS/RCS Client v{0} ====", System.Reflection.Assembly.GetEntryAssembly().GetName().Version));
            LOG.Debug("====================================================");

            //CultureInfo culture = new CultureInfo("fr-FR");
               // System.Threading.Thread.CurrentThread.CurrentCulture = culture;
               // System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

            FrameworkElement.LanguageProperty.OverrideMetadata(
                typeof(FrameworkElement),
                new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

            if (!Win32ServiceManager.SharedManager.Start())
            {
                MessageBox.Show("Failed to start service manager");
                this.Shutdown();
            }
        }
开发者ID:sarandogou,项目名称:boghe,代码行数:35,代码来源:App.xaml.cs

示例3: HandleDatabase

 /// <summary>
 /// Default constructor
 /// </summary>
 public HandleDatabase() {
     this.log = LogManager.GetLogger(this.GetType());
     if (log.IsDebugEnabled) {
         log.Debug("HandleDatabase Starts");
     }
     _conn = new SqlConnection(_connectionPath);
     if (log.IsDebugEnabled) {
         log.Debug("HandleDatabase Ends");
     }
 }
开发者ID:alpermazlum,项目名称:try_git,代码行数:13,代码来源:HandleDatabase.cs

示例4: LogWith

        public static IEnumerable<ISaga> LogWith(this IEnumerable<ISaga> sagas, ILog log)
        {
            var sagaCount = 0;

            foreach (var saga in sagas)
            {
                sagaCount++;
                log.Debug(string.Format("Loading Saga: {0}", saga.GetType().FullName));
                yield return saga;
            }
            log.Debug(string.Format("Loaded {0} Sagas", sagaCount));
        }
开发者ID:ngbrown,项目名称:EasyNetQ,代码行数:12,代码来源:SagaExtensions.cs

示例5: ToLog

        public void ToLog(ILog log)
        {
            log.Debug("\tVersion: " + Version);
            log.Debug("\tPollIntervalSeconds: " + PollIntervalSeconds);
            log.Debug("\tCollectOnly: " + CollectOnly);
            log.Debug("\tSqlEndpoints: " + Endpoints.Length);

            foreach (var endpoint in Endpoints)
            {
                endpoint.Trace(log);
            }
        }
开发者ID:jamierytlewski,项目名称:newrelic_microsoft_sqlserver_plugin,代码行数:12,代码来源:Settings.cs

示例6: BeaglePlugin

        public BeaglePlugin()
        {
            server = Daemon.Server;
            db = Daemon.DefaultDatabase;
            log = Daemon.Log;

            query = new Query ();
            query.AddDomain (QueryDomain.Neighborhood);
            query.MaxHits = 10000;

            QueryPart_Property filePart = new QueryPart_Property ();
            filePart.Type = PropertyType.Keyword;
            filePart.Key = "beagle:HitType";
            filePart.Value = "File";
            query.AddPart (filePart);

            QueryPart_Or queryUnion = new QueryPart_Or ();

            foreach (string mt in supportedMimeTypes) {
                QueryPart_Property part = new QueryPart_Property ();
                part.Type = PropertyType.Keyword;
                part.Key = "beagle:MimeType";
                part.Value = mt;
                queryUnion.Add (part);
            }

            query.AddPart (queryUnion);
            query.HitsAddedEvent += OnHitsAdded;
            query.HitsSubtractedEvent += OnHitsSubtracted;
            query.FinishedEvent += OnFinished;

            int attempts = 0;
            while (true) {
                try {
                    query.SendAsync ();
                    break;
                } catch (Exception e) {
                    if (attempts++ >= 5) {
                        log.Warn ("Failed to initialize beagle plugin");
                        query = null;
                        break;
                    }

                    // something bad happened, wait a sec and try again
                    log.Debug ("Sending query failed: " + e.Message);
                    log.Debug ("Waiting 3 seconds...");
                    Thread.Sleep (3000);
                }
            }
        }
开发者ID:snorp,项目名称:tangerine,代码行数:50,代码来源:BeaglePlugin.cs

示例7: Trace

        public override void Trace(ILog log)
        {
            base.Trace(log);

            foreach (var database in IncludedDatabases)
            {
                log.Debug("\t\t\tIncluding: " + database.Name);
            }

            foreach (var database in ExcludedDatabaseNames)
            {
                log.Debug("\t\t\tExcluding: " + database);
            }
        }
开发者ID:jamierytlewski,项目名称:newrelic_microsoft_sqlserver_plugin,代码行数:14,代码来源:SqlServer.cs

示例8: Client

        public Client(int id, Config cfg, SynchronizationContext ctx)
        {
            ClientStatisticsGatherer = new ClientStatisticsGatherer();

              _ctx = ctx;
              _id = id;

              Data = new TestData(this);
              IsStopped = false;

              _log = LogManager.GetLogger("Client_" + _id);
              _log.Debug("Client created");

              Configure(cfg);

              if (String.IsNullOrEmpty(_login))
              {
            const string err = "Login command is not specified!!! Can't do any test.";
            _log.Error(err);

            throw new Exception(err);
              }

              _ajaxHelper = new AjaxHelper(new AjaxConn(_login, cfg.ServerIp, cfg.AjaxPort, _ctx));
              _webSock = new WebSockConn(_login, cfg.ServerIp, cfg.WsPort, ctx);

              _webSock.CcsStateChanged += WsOnCcsStateChanged;
              _webSock.InitializationFinished += () => _testMng.GetTest<LoginTest>().OnClientInitialized();
              _testMng.SetEnv(_login, _ajaxHelper.AjaxConn, _webSock);
        }
开发者ID:sadstorm,项目名称:LoadTester112,代码行数:30,代码来源:Client.cs

示例9: GetLogger

        /// <summary>
        /// Get a log4net instance based on the config
        /// </summary>
        /// <returns></returns>
        public static ILog GetLogger()
        {
            //If _logger hasn't yet been initialised then create it
            if (_logger == null)
            {
                //Configure log4net if not already configured
                var configuredAlready = true;
                var logRepository = LogManager.GetRepository();
                if (!logRepository.Configured)
                {
                    configuredAlready = false;
                    log4net.Config.XmlConfigurator.Configure();
                }

                //Come up with a name for our logger eg "Template.Web v1.0.4857.27024"
                var assembly = Assembly.GetExecutingAssembly();
                var folderNames = AppDomain.CurrentDomain.SetupInformation.ApplicationBase.Split('\\');
                var loggerNamePrefix = (folderNames.Length > 2)
                    ? folderNames[folderNames.Length - 2]
                    : AppDomain.CurrentDomain.SetupInformation.ApplicationBase; //If this lives is stored in the root of a drive (unlikely) then use the path for a name
                var loggerName = string.Format("{0} v{1}",
                    loggerNamePrefix, //The path of the application executing
                    assembly.GetName().Version.ToString());

                //Get our logger
                _logger = LogManager.GetLogger(loggerName);
                _logger.Debug(string.Format("Logger {0} with this name: {1}", configuredAlready ? "retrieved" : "configured and retrieved", loggerName));
            }

            //Return instance
            return _logger;
        }
开发者ID:johnnyreilly,项目名称:TemplateSolutions,代码行数:36,代码来源:LoggerHelper.cs

示例10: LobbyBot

        /// <summary>
        ///     Setup a new bot with some details.
        /// </summary>
        /// <param name="details"></param>
        /// <param name="extensions">any extensions you want on the state machine.</param>
        public LobbyBot(SteamUser.LogOnDetails details, params IExtension<States, Events>[] extensions)
        {
            reconnect = true;
            this.details = details;

            log = LogManager.GetLogger("LobbyBot " + details.Username);
            log.Debug("Initializing a new LobbyBot, username: " + details.Username);
            reconnectTimer.Elapsed += (sender, args) =>
            {
                reconnectTimer.Stop();
                fsm.Fire(Events.AttemptReconnect);
            };
            fsm = new ActiveStateMachine<States, Events>();
            foreach (var ext in extensions) fsm.AddExtension(ext);
            fsm.DefineHierarchyOn(States.Connecting)
                .WithHistoryType(HistoryType.None);
            fsm.DefineHierarchyOn(States.Connected)
                .WithHistoryType(HistoryType.None)
                .WithInitialSubState(States.Dota);
            fsm.DefineHierarchyOn(States.Dota)
                .WithHistoryType(HistoryType.None)
                .WithInitialSubState(States.DotaConnect)
                .WithSubState(States.DotaMenu)
                .WithSubState(States.DotaLobby);
            fsm.DefineHierarchyOn(States.Disconnected)
                .WithHistoryType(HistoryType.None)
                .WithInitialSubState(States.DisconnectNoRetry)
                .WithSubState(States.DisconnectRetry);
            fsm.DefineHierarchyOn(States.DotaLobby)
                .WithHistoryType(HistoryType.None);
            fsm.In(States.Connecting)
                .ExecuteOnEntry(InitAndConnect)
                .On(Events.Connected).Goto(States.Connected)
                .On(Events.Disconnected).Goto(States.DisconnectRetry)
                .On(Events.LogonFailSteamDown).Execute(SteamIsDown)
                .On(Events.LogonFailSteamGuard).Goto(States.DisconnectNoRetry) //.Execute(() => reconnect = false)
                .On(Events.LogonFailBadCreds).Goto(States.DisconnectNoRetry);
            fsm.In(States.Connected)
                .ExecuteOnExit(DisconnectAndCleanup)
                .On(Events.Disconnected).If(ShouldReconnect).Goto(States.Connecting)
                .Otherwise().Goto(States.Disconnected);
            fsm.In(States.Disconnected)
                .ExecuteOnEntry(DisconnectAndCleanup)
                .ExecuteOnExit(ClearReconnectTimer)
                .On(Events.AttemptReconnect).Goto(States.Connecting);
            fsm.In(States.DisconnectRetry)
                .ExecuteOnEntry(StartReconnectTimer);
            fsm.In(States.Dota)
                .ExecuteOnExit(DisconnectDota);
            fsm.In(States.DotaConnect)
                .ExecuteOnEntry(ConnectDota)
                .On(Events.DotaGCReady).Goto(States.DotaMenu);
            fsm.In(States.DotaMenu)
                .ExecuteOnEntry(SetOnlinePresence);
            fsm.In(States.DotaLobby)
                .ExecuteOnEntry(EnterLobbyChat)
                .ExecuteOnEntry(EnterBroadcastChannel)
                .On(Events.DotaLeftLobby).Goto(States.DotaMenu).Execute(LeaveChatChannel);
            fsm.Initialize(States.Connecting);
        }
开发者ID:mar5,项目名称:Dota2LobbyDump,代码行数:65,代码来源:Bot.cs

示例11: InDatabaseRegionRepository

        public InDatabaseRegionRepository(PDSDatabase context)
        {
            _context = context;

            logger = LogManager.GetLogger(typeof(InDatabaseRegionRepository));
            logger.Debug("Initialisiert");
        }
开发者ID:JueZ,项目名称:SKS,代码行数:7,代码来源:InDatabaseRegionRepository.cs

示例12: MiniSSCIIServoController

        /**
         * <summary>
         * Constructor with port name and open the port.
         * Also initializes servo channels to center
         * </summary>
         *
         * <param name="portName">Name of the serial port</param>
         * <param name="channels">Channels to center on construction</param>
         */
        protected MiniSSCIIServoController(string portName, ICollection<uint> channels)
        {
            log = LogManager.GetLogger(this.GetType());
            log.Debug(this.ToString() + " constructed.");

            activeChannels = channels;
            try
            {
                port = new SerialPort(portName);
                port.Open();
                port.BaudRate = 9600;
                port.NewLine = string.Empty + Convert.ToChar(13);
                port.Handshake = System.IO.Ports.Handshake.None;
                port.BaseStream.Flush();

                port.ReadTimeout = 1000;
                inactive = false;

                foreach (uint ch in channels)
                {
                    ServoMovementCommand smc = new ServoMovementCommand(ch, 128);
                    sendCommand(smc);
                }
                log.Info("Initiating all servos to center.");
            }
            catch (IOException ex)
            {
                log.Error("Could not open Servo Controller Port on " + portName, ex);
                inactive = true;
            }
        }
开发者ID:yanatan16,项目名称:RoboNUI,代码行数:40,代码来源:ServoController.cs

示例13: CommandDatagram

 public CommandDatagram()
 {
     this.type = (int) XPiPlaneConstants.DatagramTypes.COMMAND;
     this.opcode = "CMND0";
     log = LogManager.GetLogger(opcode.Substring(0, 4));
     log.Debug("New XP Command Created");
 }
开发者ID:pfactorio,项目名称:XPiPlane,代码行数:7,代码来源:CommandDatagram.cs

示例14: DummyApiCommand

        public DummyApiCommand(IOctopusRepositoryFactory repositoryFactory, ILog log, IOctopusFileSystem fileSystem)
            : base(repositoryFactory, log, fileSystem)
        {
            var options = Options.For("Dummy");
            options.Add("pill=", "Red or Blue. Blue, the story ends. Red, stay in Wonderland and see how deep the rabbit hole goes.", v => pill = v);
			log.Debug ("Pill: " + pill);
        }
开发者ID:rodrickyu,项目名称:Octopus-Tools,代码行数:7,代码来源:DummyApiCommand.cs

示例15: Debug

 /// <summary>
 /// The debug.
 /// </summary>
 /// <param name="log">
 /// The log.
 /// </param>
 /// <param name="message">
 /// The message.
 /// </param>
 public static void Debug(ILog log, string message)
 {
     if (log != null && log.IsDebugEnabled)
     {
         log.Debug(message);
     }
 }
开发者ID:SDMXISTATFRAMEWORK,项目名称:ISTAT_ENHANCED_SDMXRI_WS,代码行数:16,代码来源:LoggingUtil.cs


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