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


C# LogData类代码示例

本文整理汇总了C#中LogData的典型用法代码示例。如果您正苦于以下问题:C# LogData类的具体用法?C# LogData怎么用?C# LogData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Save_WriteBananaToFile_Test

        public void Save_WriteBananaToFile_Test()
        {
            LogData logData = new LogData();
            logData.Category = "Fruta";
            logData.LogType = "Erro";
            logData.ObjectToLog = "Banana";
            logData.MethodName = "Save_WriteBanana_To_File";

            ConfigurationUtilityMock mock = new ConfigurationUtilityMock();
            mock.LogPath = "c:/BananaDePijama";
            mock.LogType = "File";

            IocFactory.Register(
                    Component.For<IConfigurationUtility>()
                    .Instance(mock),

                    Component.For<ILog>()
                    .ImplementedBy<FileLogProcessor>()
                    .Interceptor<LogInterceptor>()
                );

            ILog log = IocFactory.Resolve<ILog>();

            log.Save(logData);
        }
开发者ID:eduardojonssen,项目名称:TrocoSerto,代码行数:25,代码来源:FileLogProcessorTest.cs

示例2: Write

        /// <summary>
        /// Called when any message is written to the log.
        /// </summary>
        /// <param name="log">The log.</param>
        /// <param name="message">The message.</param>
        /// <param name="logEvent">The log event.</param>
        /// <param name="extraData">The additional data.</param>
        /// <param name="logData">The log data.</param>
        /// <param name="time">The time.</param>
        protected override void Write(ILog log, string message, LogEvent logEvent, object extraData, LogData logData, System.DateTime time)
        {
            base.Write(log, message, logEvent, extraData, time);

            switch (logEvent)
            {
                case LogEvent.Debug:
                    _eventSource.Debug(message);
                    break;

                case LogEvent.Info:
                    _eventSource.Info(message);
                    break;

                case LogEvent.Warning:
                    _eventSource.Warning(message);
                    break;

                case LogEvent.Error:
                    _eventSource.Error(message);
                    break;

                default:
                    throw new ArgumentOutOfRangeException("logEvent");
            }
        }
开发者ID:matthijskoopman,项目名称:Catel,代码行数:35,代码来源:EtwLogListener.cs

示例3: Write

            protected override void Write(ILog log, string message, LogEvent logEvent, object extraData, LogData logData, DateTime time)
            {
                if (log.TargetType != typeof(TestLogListener))
                {
                    return;
                }

                switch (logEvent)
                {
                    case LogEvent.Debug:
                        DebugCount++;
                        break;

                    case LogEvent.Info:
                        InfoCount++;
                        break;

                    case LogEvent.Warning:
                        WarningCount++;
                        break;

                    case LogEvent.Error:
                        ErrorCount++;
                        break;

                    case LogEvent.Status:
                        StatusCount++;
                        break;
                }
            }
开发者ID:Catel,项目名称:Catel,代码行数:30,代码来源:LogManagerTest.cs

示例4: Post

 public void Post(LogData data)
 {
     data.User = GetCurrentSession().User;
     var log = GetLog(data);
     var @event = CreateEvent(data, log);
     SaveMeasurements(data.User, log, @event, data.Measurements);
     SaveTags(log, data.User, @event, data.Tags);
 }
开发者ID:chrisharrington,项目名称:LogWhatever,代码行数:8,代码来源:LogsController.cs

示例5: WriteLog

        /// <summary>
        /// Writes the specified LogData to NLog.
        /// </summary>
        /// <param name="logData">The log data.</param>
        public static void WriteLog(LogData logData)
        {
            var logEvent = logData.ToLogEvent();
            var name = logData.Logger ?? typeof(NLogWriter).FullName;

            var logger = global::NLog.LogManager.GetLogger(name);
            logger.Log(logEvent);
        }
开发者ID:modulexcite,项目名称:KickStart,代码行数:12,代码来源:NLogWriter.cs

示例6: LogMessageEventArgs

 /// <summary>
 /// Initializes a new instance of the <see cref="LogMessageEventArgs" /> class.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="message">The message.</param>
 /// <param name="extraData">The extra data.</param>
 /// <param name="logData">The log data.</param>
 /// <param name="logEvent">The log event.</param>
 /// <param name="time">The time.</param>
 public LogMessageEventArgs(ILog log, string message, object extraData, LogData logData, LogEvent logEvent, DateTime time)
 {
     Log = log;
     Time = time;
     Message = message;
     ExtraData = extraData;
     LogEvent = logEvent;
     LogData = logData;
 }
开发者ID:Catel,项目名称:Catel,代码行数:18,代码来源:LogMessageEventArgs.cs

示例7: Write

 protected override void Write(ILog log, string message, LogEvent logEvent, object extraData, LogData logData, DateTime time)
 {
     _textBox.Dispatcher.Invoke(() =>
     {
         _textBox.AppendText(string.Format("{0} {1}", time.ToString("HH:mm:ss.fff"), message));
         _textBox.AppendText(Environment.NewLine);
         _textBox.ScrollToEnd();
     });
 }
开发者ID:WildGums,项目名称:Orc.Wizard,代码行数:9,代码来源:TextBoxLogListener.cs

示例8: ShouldIgnoreLogMessage

        protected override bool ShouldIgnoreLogMessage(ILog log, string message, LogEvent logEvent, object extraData, LogData logData, DateTime time)
        {
            if (message.StartsWith("Uninitialized"))
            {
                return true;
            }

            return false;
        }
开发者ID:sk8tz,项目名称:Orc.Controls,代码行数:9,代码来源:ExampleLogListener.cs

示例9: GetLog

 private Log GetLog(LogData data)
 {
     var log = LogRepository.Name(data.Name);
     if (log == null)
     {
         log = new Log { Id = Guid.NewGuid(), Name = data.Name, UserId = data.User.Id };
         LogRepository.Create(log);
     }
     return log;
 }
开发者ID:chrisharrington,项目名称:LogWhatever,代码行数:10,代码来源:LogsController.cs

示例10: Reverse

 public Reverse(Stage stage, Game1 game, ContentManager content)
 {
     this.game = game;
     this.stage = stage;
     this.content = content;
     nowlogdata = new LogData();
     reverseLog = new List<LogData>();
     score_prev = 0;
     tasSound = content.Load<SoundEffect>("Audio\\SE\\TAS");
 }
开发者ID:pentiumx,项目名称:Tasrush-2DActionGame,代码行数:10,代码来源:Reverse.cs

示例11: Save

        public void Save(LogData logData)
        {
            EventLog log = new EventLog();

            log.Source = "Troco$erto";

            string logMessage = Serializer.JsonSerialize(logData.ObjectToLog);

            log.WriteEntry(logMessage, EventLogEntryType.Information);
        }
开发者ID:eduardojonssen,项目名称:TrocoSerto,代码行数:10,代码来源:SystemLogProcessor.cs

示例12: LogMessage

		/// <summary>
		/// メッセージを記録する
		/// </summary>
		/// <param name="message"></param>
		public void LogMessage(string message)
		{
			if (_saveLog) {
				LogData data = new LogData(LogData.LogType.Message, message);
				Loglist.Add(data);

				DebugWrite(message);

			}

		}
开发者ID:nico-lab,项目名称:niconama-ocv,代码行数:15,代码来源:Logger.cs

示例13: Log

    public static void Log( LogData playClipData )
    {
        playClipData.time = Time.time;

        if ( logData.Count >= 1024 )
        {
            logData.RemoveLast();
        }

        logData.AddFirst( playClipData );

        _OnLogUpdated();

    }
开发者ID:timmypowergamer,项目名称:RitualShooter,代码行数:14,代码来源:AudioLog.cs

示例14: WriteLog

        private static void WriteLog(LogData logData, Action<object> logAction, Action<object, Exception> errorAction)
        {
            bool isFormatted = logData.Parameters != null && logData.Parameters.Length > 0;

            string message = isFormatted
                ? string.Format(logData.FormatProvider, logData.Message, logData.Parameters)
                : logData.Message;


            if (logData.Exception == null)
                logAction(message);
            else
                errorAction(message, logData.Exception);
        }
开发者ID:modulexcite,项目名称:KickStart,代码行数:14,代码来源:Log4NetWriter.cs

示例15: Write

        /// <summary>
        /// Called when any message is written to the log.
        /// </summary>
        /// <param name="log">The log.</param>
        /// <param name="message">The message.</param>
        /// <param name="logEvent">The log event.</param>
        /// <param name="extraData">The additional data.</param>
        /// <param name="logData">The log data.</param>
        /// <param name="time">The time.</param>
        protected override void Write(ILog log, string message, LogEvent logEvent, object extraData, LogData logData, DateTime time)
        {
            lock (_lock)
            {
                _logBatch.Add(new LogBatchEntry(log, message, logEvent, extraData, logData, time));

                if (_logBatch.Count >= MaximumBatchCount)
                {
                    // TODO: remove pragma in 5.0.0
#pragma warning disable 4014
                    Flush();
#pragma warning restore 4014
                }
            }
        }
开发者ID:rishabh8,项目名称:Catel,代码行数:24,代码来源:BatchLogListenerBase.cs


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