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


C# Logger.Debug方法代码示例

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


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

示例1: Humidity_Air_HIH4000

        public Humidity_Air_HIH4000(string Name, bool Simulation, Adc_MCP3208 adc, int channel, Logger Logger)
            : base(Name, Simulation, Logger)
        {
            logger.Debug("Humidity_Air_HIH4000-Constructor_00");
            logger = Logger;

            logger.Debug("Humidity_Air_HIH4000-Constructor_10");

            this.Adc = adc;
            logger.Debug("Humidity_Air_HIH4000-Constructor_11");

            MinValue = 0;
            MaxValue = 100;

            AlarmMin = MinValue;
            AlarmMax = MaxValue;

            voltage = 3.3;

            Channel = channel;
            firstValue = true;

            if (Simulation)
                SetFirstValue();

            Initialization();
            logger.Debug("Humidity_Air_HIH4000-Constructor_99");
        }
开发者ID:gamondue,项目名称:GOR-4H-16,代码行数:28,代码来源:Humidity_Air_HIH4000.cs

示例2: CSharpProject

        public CSharpProject(ISolution solution, 
                             Logger logger, 
                             string folderPath, 
                             IFileSystem fileSystem)
            : base(fileSystem, logger)
        {
            _fileSystem = fileSystem;
            _logger = logger;
            _solution = solution;

            Files = new List<CSharpFile>();
            References = new List<IAssemblyReference>();

            DirectoryInfoBase folder;

            try
            {
                folder = _fileSystem.DirectoryInfo.FromDirectoryName(folderPath);
            }
            catch (DirectoryNotFoundException)
            {
                logger.Error("Directory not found - " + folderPath);
                return;
            }

            var files = folder.GetFiles("*.cs", SearchOption.AllDirectories);
            foreach (var file in files)
            {
                _logger.Debug("Loading " + file.FullName);
                Files.Add(new CSharpFile(this, file.FullName));
            }

            this.ProjectContent = new CSharpProjectContent()
                .SetAssemblyName(AssemblyName)
                .AddAssemblyReferences(References)
                .AddOrUpdateFiles(Files.Select(f => f.ParsedFile));

            AddMsCorlib();
            AddReference(LoadAssembly(FindAssembly("System.Core")));


            var dlls = folder.GetFiles("*.dll", SearchOption.AllDirectories);
            foreach (var dll in dlls)
            {
                _logger.Debug("Loading assembly " + dll.FullName);
                AddReference(dll.FullName);
            }
        }
开发者ID:jcd-as,项目名称:omnisharp-server,代码行数:48,代码来源:CSharpProject.cs

示例3: HOOService

 public HOOService(object dep)
 {
     log = new Logger("HOO.SvcLib", this.GetType());
     log.Entry.MethodName = "Constructor";
     log.Entry.StepName = "Start";
     log.Debug(dep.ToString());
     if (dep is List<Universe>)
         this.World = (List<Universe>)dep;
 }
开发者ID:GSazheniuk,项目名称:HOO,代码行数:9,代码来源:HOOService.cs

示例4: DebugDoesNotLogWhenLogLevelAtInformation

        public async Task DebugDoesNotLogWhenLogLevelAtInformation()
        {
            // Arrange
            Logger logger = new Logger(_runtimeEnvironment.Object, _queue.Object, _source.Object, _extension.Object, LogLevelEnum.Information, _correlationIdProvider.Object);

            // Act
            await logger.Debug("a message");

            // Assert
            _queue.Verify(x => x.EnqueueAsync(It.IsAny<LogQueueItem>()), Times.Never);
        }
开发者ID:vvmoppescapita,项目名称:AccidentalFish.ApplicationSupport,代码行数:11,代码来源:LoggerTests.cs

示例5: Debug_WithoutWriter

		public void Debug_WithoutWriter()
		{
			// arrange
			var logger = new Logger();

			// act
			var ex = Assert.Throws<Exception>(() => logger.Debug("debug message"));

			// assert
			Assert.Equal("The writer must be set with the 'SetWriter' method first.", ex.Message);
		}
开发者ID:gitter-badger,项目名称:vika,代码行数:11,代码来源:LoggerTest.cs

示例6: Debug_WithoutCategoryAdded

		public void Debug_WithoutCategoryAdded()
		{
			// arrange
			var logger = new Logger();
			var logs = new StringBuilder();
			logger.SetWriter(new StringWriter(logs));

			// act
			logger.Debug("debug message");

			// assert
			Assert.Equal(string.Empty, logs.ToString());
		}
开发者ID:gitter-badger,项目名称:vika,代码行数:13,代码来源:LoggerTest.cs

示例7: HouseKeepingHandler

        public HouseKeepingHandler(TCPWrapper MyTCPWrapper, MySqlManager MyMySqlManager, Logger MyLogger, errorHandler MyErrorHandler)
        {
            this.TheLogger = MyLogger;
            this.TheMySqlManager = MyMySqlManager;
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheErrorHandler = MyErrorHandler;

            TheTCPWrapper = MyTCPWrapper;
            TheMySqlManager = MyMySqlManager;
            TheLogger.Debug("New HouseKeepingTimer.Interval: " + this.HouseKeepingTimer.Interval + "\n");

            HouseKeepingTimer.Elapsed += new ElapsedEventHandler(HouseKeepingTimer_Tick);
            TheTCPWrapper.GotConnected += new TCPWrapper.GotConnectedEventHandler(OnGotConnected);
            TheTCPWrapper.GotDisconnected += new TCPWrapper.GotDisconnectedEventHandler(OnGotDisconnected);
        }
开发者ID:bignall,项目名称:CS-ELBot,代码行数:15,代码来源:housekeeping.cs

示例8: Error

		public void Error()
		{
			// arrange
			var logger = new Logger();
			var logs = new StringBuilder();
			logger.SetWriter(new StringWriter(logs));
			logger.AddCategory("error");

			// act
			logger.Debug("debug message");
			logger.Info("info message");
			logger.Error("error message");

			// assert
			Assert.Equal("error message", logs.ToString().Trim());
		}
开发者ID:gitter-badger,项目名称:vika,代码行数:16,代码来源:LoggerTest.cs

示例9: Logger_Debug

        public void Logger_Debug()
        {
            const string message = "message";
            int counter = 0;
            ILogger logger = new Logger();
            (logger as Logger).OnCritical = s => Assert.Fail();
            (logger as Logger).OnError = s => Assert.Fail();
            (logger as Logger).OnWarning = s => Assert.Fail();
            (logger as Logger).OnInformational = s => Assert.Fail();
            (logger as Logger).OnDebug = s => counter++;
            (logger as Logger).OnDiagnostic = s => Assert.Fail();
            (logger as Logger).OnChangeEvent = (a, b) => Assert.Fail();

            logger.Debug(message);
            Assert.AreEqual(1, counter);
        }
开发者ID:hakelimopu,项目名称:wandermaze,代码行数:16,代码来源:LoggerTests.cs

示例10: Temperature_DS1822

 /// <summary>
 /// Costruttore senza ID del sensore, trovato automaticamente dal software
 /// Prende il primo termometro che trova 
 /// </summary>
 /// <param name="Name"></param>
 /// <param name="Simulation"></param>
 /// <param name="Logger"></param>
 public Temperature_DS1822(string Name, bool Simulation, Logger Logger)
     : base(Name, Simulation, Logger)
 {
     Logger.Debug("Temperature_DS1822_Constructor senza ID. SensorId automatico");
     if (!Simulation)
     {
         // creazione del termometro; se il parametro DeviceIndex = 0 usa il primo sensore che trova
         try
         {
             termometro = new Ds18b20Connection(0);
         }
         catch (Exception ex)
         {
             Logger.Error("Temperature_DS1822_Constructor senza ID. " + ex.Message);
             return;
         }
     }
     Initialization();
 }
开发者ID:gamondue,项目名称:GOR-4H-16,代码行数:26,代码来源:Temperature_DS1822.cs

示例11: TestLogging

        public void TestLogging()
        {
            var config = new FileConfiguration
                {
                    CreateDateFolder = true,
                    DaysToKeep = 3,
                    Path = AppDomain.CurrentDomain.BaseDirectory
                };

            var target = new FileTarget("Everything", config);

            target.Enqueue(new LogEntry
                {
                    CreatedAt = DateTime.Now,
                    LogLevel = LogLevel.Debug,
                    Message = "Hello world",
                    LoggedType = GetType(),
                    MethodName = MethodBase.GetCurrentMethod().Name,
                    ThreadId = Thread.CurrentThread.ManagedThreadId,
                    UserName = Thread.CurrentPrincipal.Identity.Name
                               ?? Environment.UserName
                });

            var target2 = new PaddedFileTarget("EVeryone", config);
            target2.Enqueue(new LogEntry
                {
                    CreatedAt = DateTime.Now,
                    LogLevel = LogLevel.Debug,
                    Message = "Hello world",
                    LoggedType = GetType(),
                    MethodName = MethodBase.GetCurrentMethod().Name,
                    ThreadId = Thread.CurrentThread.ManagedThreadId,
                    UserName = Thread.CurrentPrincipal.Identity.Name
                               ?? Environment.UserName
                });

            var logger = new Logger(GetType(), new[] {target2, target});
            logger.Info("Hello");
            logger.Debug("Hello");
            logger.Warning("Hello");
            logger.Error("Hello");
        }
开发者ID:jmptrader,项目名称:Griffin.Logging,代码行数:42,代码来源:TextLogger.cs

示例12: AdvertHandler

        public AdvertHandler(TCPWrapper MyTCPWrapper, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory, errorHandler MyErrorHandler)
        {
            Random RandomClass = new Random();
            int i;
            this.TheLogger = MyLogger;
            this.TheMySqlManager = MyMySqlManager;
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheTradeHandler = MyTradeHandler;
            this.TheInventory = MyInventory;
            this.TheErrorHandler = MyErrorHandler;

            TheTCPWrapper = MyTCPWrapper;
            TheMySqlManager = MyMySqlManager;
            TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand);
            if (TheMySqlManager.advertise())
            {
                this.AdvertTimer.Interval = 1000;
                if (TheMySqlManager.advertchannel(Settings.botid) != 99999999)
                {
                    //if (TheMySqlManager.lastadverttime(Settings.botid) + TheMySqlManager.minadverttime() <= DateTime.Now )
                    if (TheMySqlManager.lastadverttime(Settings.botid) <= TheMySqlManager.minadverttime())
                    {
                        i = TheMySqlManager.minadverttime() * 1000;
                        i += (RandomClass.Next(0, TheMySqlManager.randomadvertdelay()) * 1000);
                        if (i < 900000)
                            i = 900000;//minimum 15 minute delay
                        this.AdvertTimer.Interval = i;
                    }
                }
            }
            else
            {
                this.AdvertTimer.Interval = 900000;
            }

            TheLogger.Debug("New AdvertTimer.Interval: " + this.AdvertTimer.Interval + "\n");

            AdvertTimer.Elapsed += new ElapsedEventHandler(AdvertTimer_Tick);
            TheTCPWrapper.GotConnected += new TCPWrapper.GotConnectedEventHandler(OnGotConnected);
            TheTCPWrapper.GotDisconnected += new TCPWrapper.GotDisconnectedEventHandler(OnGotDisconnected);
        }
开发者ID:bignall,项目名称:CS-ELBot,代码行数:41,代码来源:AdvertHandler.cs

示例13: TestLogging

        public void TestLogging()
        {
            var config = new FileConfiguration
                             {
                                 CreateDateFolder = true,
                                 DaysToKeep = 3,
                                 Path = @"d:\logfiles"
                             };

            var target = new FileTarget("Everything", config);

            target.Enqueue(new LogEntry
                               {
                                   CreatedAt = DateTime.Now,
                                   LogLevel = LogLevel.Debug,
                                   Message = "Hello world",
                                   StackFrames = new StackTrace().GetFrames(),
                                   ThreadId = Thread.CurrentThread.ManagedThreadId,
                                   UserName = Thread.CurrentPrincipal.Identity.Name
                                              ?? Environment.UserName
                               });

            var target2 = new PaddedFileTarget("EVeryone", config);
            target2.Enqueue(new LogEntry
                                {
                                    CreatedAt = DateTime.Now,
                                    LogLevel = LogLevel.Debug,
                                    Message = "Hello world",
                                    StackFrames = new StackTrace().GetFrames(),
                                    ThreadId = Thread.CurrentThread.ManagedThreadId,
                                    UserName = Thread.CurrentPrincipal.Identity.Name
                                               ?? Environment.UserName
                                });

            var logger = new Logger(GetType(), new[] {target2, target});
            logger.Info("Hello");
            logger.Debug("Hello");
            logger.Warning("Hello");
            logger.Error("Hello");
        }
开发者ID:jmptrader,项目名称:griffin,代码行数:40,代码来源:TextLogger.cs

示例14: AltAdvertHandler

        public AltAdvertHandler(TCPWrapper MyTCPWrapper, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory, errorHandler MyErrorHandler)
        {
            Random RandomClass = new Random();
            int i;
            this.TheLogger = MyLogger;
            this.TheMySqlManager = MyMySqlManager;
            this.TheTCPWrapper = MyTCPWrapper;
            this.TheTradeHandler = MyTradeHandler;
            this.TheInventory = MyInventory;
            this.TheErrorHandler = MyErrorHandler;

            TheTCPWrapper = MyTCPWrapper;
            TheMySqlManager = MyMySqlManager;
            uint altadvertchannel = TheMySqlManager.altadvertchannel(Settings.botid);
            this.AltAdvertTimer.Interval = 900000;
            if (TheMySqlManager.altadvertise())
            {
                this.AltAdvertTimer.Interval = 1000;
                if (altadvertchannel != 99999999)
                {
                    if (TheMySqlManager.lastaltadverttime(Settings.botid) <= TheMySqlManager.minaltadverttime())
                    {
                        i = TheMySqlManager.minaltadverttime() * 1000;
                        i += (RandomClass.Next(0, TheMySqlManager.randomaltadvertdelay()) * 1000);
                        if (i < 900000)
                            i = 900000;//minimum 15 minute delay
                        this.AltAdvertTimer.Interval = i;
                    }
                }
            }

            TheLogger.Debug("New AltAdvertTimer.Interval: " + this.AltAdvertTimer.Interval + "\n");

            if (altadvertchannel != 99999999 && TheMySqlManager.lastaltadverttime(Settings.botid) < TheMySqlManager.minaltadverttime() && MainClass.serverName != "test")
                return;

            AltAdvertTimer.Elapsed += new ElapsedEventHandler(AltAdvertTimer_Tick);
            TheTCPWrapper.GotConnected += new TCPWrapper.GotConnectedEventHandler(OnGotConnected);
            TheTCPWrapper.GotDisconnected += new TCPWrapper.GotDisconnectedEventHandler(OnGotDisconnected);
        }
开发者ID:bignall,项目名称:CS-ELBot,代码行数:40,代码来源:AltAdvertsHandler.cs

示例15: Execute

 public void Execute(Logger log)
 {
     if (File.Exists(_filePath)) {
         using (StreamReader reader = new StreamReader(File.OpenRead(_filePath))) {
             _contents.Append(reader.ReadToEnd());
             reader.Close();
         }
     } else {
         log.Debug("{1}: File {0} does not exist.", _filePath, Name);
     }
 }
开发者ID:wa-research,项目名称:ServiceManager,代码行数:11,代码来源:FileWatcherBase.FolderOperations.cs


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