Example #1
0
 public void WriteLine(ILogItem item)
 {
     if (item.LogLevel >= _threshold && item.LogLevel <= LogLevel.Error)
     {
         _aggregatedList[item.LogLevel].Add(item);
     }
 }
Example #2
0
 private void WriteLine(ILogItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException(nameof(item));
     }
     if (item.File == null)
     {
         return;
     }
     string fileFromWorkingDir = StringExtension.BackSlashToForwardSlash(item.File);
     if (!PathUtility.IsRelativePath(item.File))
     {
         fileFromWorkingDir = PathUtility.MakeRelativePath(EnvironmentContext.BaseDirectory, item.File);
     }
     List<LogItem> logsPerFile;
     if (!_logs.TryGetValue(fileFromWorkingDir, out logsPerFile))
     {
         logsPerFile = _logs[fileFromWorkingDir] = new List<LogItem>();
     }
     logsPerFile.Add(new LogItem
     {
         File = StringExtension.BackSlashToForwardSlash(item.File),
         Line = item.Line,
         LogLevel = item.LogLevel,
         Message = item.Message,
         Phase = item.Phase,
     });
 }
Example #3
0
 /// <summary>
 /// Writes a log item to the storage
 /// </summary>
 /// <param name="item">Log Item</param>
 public Task WriteAsync(ILogItem item)
 {
     if (!_enabled)
     {
         return(Task.CompletedTask);
     }
     if (Interlocked.Increment(ref _count) < 10_000)
     {
         _sourceItems.Add(new SourceData
         {
             timestamp       = item.Timestamp,
             level           = item.Level,
             message         = item.Message,
             instanceId      = Core.InstanceId,
             environmentName = item.EnvironmentName,
             machineName     = item.MachineName,
             applicationName = item.ApplicationName,
             processName     = item.ProcessName,
             assemblyName    = item.AssemblyName,
             code            = item.Code,
             groupName       = item.GroupName,
             exception       = item.Exception
         });
     }
     return(Task.CompletedTask);
 }
Example #4
0
 public void WriteLine(ILogItem item)
 {
     if (item.LogLevel >= LogLevel.Suggestion)
     {
         _bmi.WriteLine(item);
     }
 }
Example #5
0
 public void WriteLine(ILogItem item)
 {
     if (item.LogLevel >= LogLevel.Warning)
     {
         _bmi.WriteLine(item);
     }
 }
Example #6
0
        //private IServiceProvider serviceProvider;

        public void AddLogItem(ILogItem log)
        {
            // since we are using EF to add to the log we need ot avoid
            // logging EF related things, otherwise every time we log we generate more log events
            // continuously
            // might be better to use the normal mssql ado log repository instead
            // need to decouple logging repos from core repos

            if (log.Logger.Contains("EntityFrameworkCore"))
            {
                return;
            }

            var logItem = LogItem.FromILogItem(log);

            using (var context = new LoggingDbContext(dbContextOptions))
            {
                context.Add(logItem);
                context.SaveChanges();
            }

            // learned by experience for this situation we need to create transient instance of the dbcontext
            // for logging because the dbContext we have passed in is scoped to the request
            // and it causes problems to save changes on the context multiple times during a request
            // since we may log mutliple log items in a given request we need to create the dbcontext as needed
            // we can still use the normal dbContext for querying
            //dbContext.Add(logItem);
            //dbContext.SaveChanges();

            //return logItem.Id;
        }
Example #7
0
 public void WriteLine(ILogItem item)
 {
     if (item.Phase == Phase)
     {
         Items.Add(item);
     }
 }
Example #8
0
        public void WriteLine(ILogItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            var level   = item.LogLevel;
            var message = item.Message;
            var phase   = item.Phase;
            var file    = item.File;
            var line    = item.Line;

            if (level < LogLevelThreshold)
            {
                return;
            }

            var reportItem = new ReportItem
            {
                Severity      = GetSeverity(level),
                Message       = message,
                Source        = phase,
                File          = TransformFile(file),
                Line          = line,
                DateTime      = DateTime.UtcNow,
                Code          = item.Code,
                CorrelationId = item.CorrelationId
            };

            _writer.WriteLine(JsonUtility.Serialize(reportItem));
        }
Example #9
0
 private void WriteLineCore(ILogItem item)
 {
     foreach (var listener in _listeners)
     {
         listener.WriteLine(item);
     }
 }
Example #10
0
        public void WriteLine(ILogItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            var level   = item.LogLevel;
            var message = item.Message;
            var phase   = item.Phase;
            var file    = item.File;
            var line    = item.Line;

            if (level < LogLevelThreshold)
            {
                return;
            }

            var reportItem = new ReportItem
            {
                Severity = GetSeverity(level),
                Message  = message,
                Source   = phase,
                File     = file,
                Line     = line,
                DateTime = DateTime.UtcNow
            };

            _writer.WriteLine($"<tr><td>{reportItem.Severity}</td><td>{Escape(reportItem.Message)}</td><td>{Escape(reportItem.File)}</td><td>{reportItem.Line}</td><td>{reportItem.DateTime}</td></tr>");
        }
Example #11
0
        public void WriteLine(ILogItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            var level = item.LogLevel;
            var message = item.Message;
            var phase = item.Phase;
            var file = item.File;
            var line = item.Line;
            if (level < LogLevelThreshold) return;

            var reportItem = new ReportItem
            {
                Severity = GetSeverity(level),
                Message = message,
                Source = phase,
                File = file,
                Line = line,
                DateTime = DateTime.UtcNow
            };

            _writer.WriteLine(JsonUtility.Serialize(reportItem));
        }
 public void WriteLine(ILogItem item)
 {
     if (item.Phase == Phase)
     {
         Items.Add(item);
     }
 }
Example #13
0
        public static void Log(ILogItem item)
        {
            if (item.LogLevel < LogLevelThreshold)
            {
                return;
            }

            if (item.LogLevel == LogLevel.Warning)
            {
                var count = Interlocked.Increment(ref _warningCount);
                if (count > WarningThrottling)
                {
                    return;
                }
                else if (count == WarningThrottling)
                {
                    var msg = new LogItem
                    {
                        Code     = WarningCodes.Build.TooManyWarnings,
                        LogLevel = LogLevel.Warning,
                        Message  = "Too many warnings, no more warning will be logged."
                    };
                    _syncListener.WriteLine(msg);
                    _asyncListener.WriteLine(msg);
                }
            }

            if (item.LogLevel == LogLevel.Error)
            {
                HasError = true;
            }

            _syncListener.WriteLine(item);
            _asyncListener.WriteLine(item);
        }
Example #14
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="item">Item</param>
 /// <param name="parent">Parent</param>
 public LogItemWrapper(LogDirectoryWrapper parent, ILogData item)
 {
     this.item   = item;
     this.parent = parent;
     parent.items.Add(this);
     StaticExtensionEventLogDatabase.items[item.Id] = this;
 }
Example #15
0
        public void AddLogItem(ILogItem log)
        {
            var logItem = LogItem.FromILogItem(log);

            var pathToFile = ResolvePath(
                logItem.Id.ToString(),
                logItem,
                ".json",
                true
                );

            if (File.Exists(pathToFile))
            {
                return;
            }

            var serialized = JsonConvert.SerializeObject(
                logItem,
                Formatting.None,
                new JsonSerializerSettings {
                DefaultValueHandling = DefaultValueHandling.Include
            });

            using (StreamWriter s = File.CreateText(pathToFile))
            {
                s.Write(serialized);
            }
        }
        public void Log(ILogItem item)
        {
            try
            {
                if (!isInitialized)
                {
                    Initialize();
                }

                if (LoggingMode.Trim().ToUpperInvariant() == LogMode.Asynchronous.ToString().Trim().ToUpperInvariant())
                {
                    AddToQueue(item);
                }
                else
                {
                    foreach (KeyValuePair <int, ILogger> keyValuePair in TargetLoggers)
                    {
                        try
                        {
                            keyValuePair.Value.Log(item);
                            break; // If no exception stop targetting the remaining loggers
                        }
                        catch (Exception)
                        {
                            continue; // If exception occured in the higher priority logger, process next logger
                        }
                    }
                }
            }
            catch (Exception)
            {
                // The exception throw is suppressed so that applications dont get runtime errors
                // if logging fails for any reason
            }
        }
Example #17
0
        public async Task WriteAsync(ILogItem item)
        {
            if (!LevelAllowed.HasFlag(item.Level))
            {
                return;
            }
            var msg = string.Format("{0}\r\nMachine Name: {1} [{2}]\r\nAplicationName: {3}\r\nMessage: {4}", item.Timestamp.ToString("dd/MM/yyyy HH:mm:ss"), item.MachineName, item.EnvironmentName, item.ApplicationName, item.Message);

            if (item.Exception != null)
            {
                if (!string.IsNullOrEmpty(item.Exception.ExceptionType))
                {
                    msg += "\r\nException: " + item.Exception.ExceptionType;
                }
                if (SendStackTrace && !string.IsNullOrEmpty(item.Exception?.StackTrace))
                {
                    msg += "\r\nStack Trace: " + item.Exception.StackTrace;
                }
                if (item.Exception.StackTrace.Contains("TelegramBotTransport.<<ConnectAsync>"))
                {
                    return;
                }
            }
            await Bot.SendTextMessageToTrackedChatsAsync(msg).ConfigureAwait(false);
        }
Example #18
0
        public void WriteLine(ILogItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            var level = item.LogLevel;
            var message = item.Message;
            var phase = item.Phase;
            var file = item.File;
            var line = item.Line;
            if (level < LogLevelThreshold) return;
            var formatter = level + ": " + message;
            if (!string.IsNullOrEmpty(phase))
            {
                formatter += " in phase " + phase;
            }
            if (!string.IsNullOrEmpty(file))
            {
                formatter += " in file " + file;
                if (!string.IsNullOrEmpty(line)) formatter += " line " + line;
            }

            var foregroundColor = Console.ForegroundColor;
            try
            {
                ChangeConsoleColor(level);
                Console.WriteLine(formatter);
            }
            finally
            {
                Console.ForegroundColor = foregroundColor;
            }
        }
Example #19
0
 /// <inheritdoc />
 /// <summary>
 /// Writes a log item to the storage
 /// </summary>
 /// <param name="item">Log Item</param>
 public Task WriteAsync(ILogItem item)
 {
     if (!_enabled)
     {
         return(Task.CompletedTask);
     }
     if (Interlocked.Increment(ref _count) < 10_000)
     {
         _items.Add(new LogItem
         {
             InstanceId      = Core.InstanceId,
             Id              = item.Id,
             EnvironmentName = item.EnvironmentName,
             MachineName     = item.MachineName,
             ApplicationName = item.ApplicationName,
             ProcessName     = item.ProcessName,
             AssemblyName    = item.AssemblyName,
             TypeName        = item.TypeName,
             GroupName       = item.GroupName,
             Code            = item.Code,
             Exception       = item.Exception,
             Level           = item.Level,
             Message         = item.Message,
             Timestamp       = item.Timestamp
         });
     }
     return(Task.CompletedTask);
 }
Example #20
0
        private void WriteLine(ILogItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            if (item.File == null)
            {
                return;
            }
            string fileFromWorkingDir = StringExtension.BackSlashToForwardSlash(item.File);

            if (!PathUtility.IsRelativePath(item.File))
            {
                fileFromWorkingDir = PathUtility.MakeRelativePath(EnvironmentContext.BaseDirectory, item.File);
            }
            if (!_logs.TryGetValue(fileFromWorkingDir, out List <LogItem> logsPerFile))
            {
                logsPerFile = _logs[fileFromWorkingDir] = new List <LogItem>();
            }
            logsPerFile.Add(new LogItem
            {
                File     = StringExtension.BackSlashToForwardSlash(item.File),
                Line     = item.Line,
                LogLevel = item.LogLevel,
                Message  = item.Message,
                Phase    = item.Phase,
                Code     = item.Code
            });
        }
        void GetUrl()
        {
            if (log == null)
            {
                return;
            }
            string   url = log.Url;
            TreeNode n   = treeViewMain.Find(url);

            if (n != null)
            {
                if (treeViewMain.SelectedNode == n)
                {
                    return;
                }
                treeViewMain.SelectedNode = n;
                ILogItem d = n.Tag as ILogItem;
                toolStripLabelSize.Text    = "Length = " + d.GetLength();
                toolStripLabelSize.Visible = true;
            }
            else
            {
                toolStripLabelSize.Visible = false;
            }
        }
Example #22
0
 public void WriteLine(ILogItem item)
 {
     if (item.LogLevel >= _replayLevel && item.LogLevel <= LogLevel.Error)
     {
         _replayList[item.LogLevel].Add(item);
     }
     WriteLineCore(item);
 }
Example #23
0
 /// <summary>
 /// log an item (impl.)
 /// </summary>
 /// <param name="logItem">log item</param>
 public override void Log(ILogItem logItem)
 {
     if (LogAction == null)
     {
         throw new NotImplementedException();
     }
     LogAction.Invoke(logItem);
 }
Example #24
0
 public void WriteLine(ILogItem item)
 {
     if (item.LogLevel >= _replayLevel && item.LogLevel <= LogLevel.Error)
     {
         _replayList[item.LogLevel].Add(item);
     }
     WriteLineCore(item);
 }
Example #25
0
 public void WriteLine(ILogItem item)
 {
     if (_inner.Count == 0)
     {
         return;
     }
     AddLogToQueue(item);
 }
Example #26
0
        public async Task WriteAsync(ILogItem item)
        {
            EnsureLogFile(FileName);
            if (_sWriter is null)
            {
                return;
            }
            if (!StringBuilderPool.TryPop(out var strBuffer))
            {
                strBuffer = new StringBuilder();
            }
            var time   = item.Timestamp.GetTimeSpanFormat();
            var format = PreFormat;

            if (_firstWrite)
            {
                strBuffer.AppendFormat(PreFormat, "EmptyLine", "<br/>");
                strBuffer.AppendFormat(PreFormat, "EmptyLine", "<br/>");
                strBuffer.AppendFormat(PreFormat, "EmptyLine", "<br/>");
                strBuffer.AppendFormat(PreFormat, "EmptyLine", "<br/>");
                strBuffer.AppendFormat(PreFormat, "EmptyLine", "<br/>");
                strBuffer.AppendFormat(PreFormatWTime, "Start", "&#8615; START &#8615;", time);
                _firstWrite = false;
            }
            strBuffer.Append(time);
            strBuffer.AppendFormat("{0, 11}: ", item.Level);

            if (!string.IsNullOrEmpty(item.GroupName))
            {
                strBuffer.Append(item.GroupName + " | ");
            }

            if (!string.IsNullOrEmpty(item.TypeName))
            {
                strBuffer.Append("&lt;" + item.TypeName + "&gt; ");
                format = PreFormatWType;
            }

            if (!string.IsNullOrEmpty(item.Code))
            {
                strBuffer.Append("[" + item.Code + "] ");
            }

            strBuffer.Append(System.Security.SecurityElement.Escape(item.Message));

            if (item.Exception != null)
            {
                strBuffer.Append("\r\nExceptions:\r\n");
                GetExceptionDescription(item.Exception, strBuffer);
            }
            var buffer = strBuffer.ToString();

            strBuffer.Clear();
            StringBuilderPool.Push(strBuffer);
            await _sWriter.WriteAsync(string.Format(format, item.Level, buffer, item.TypeName)).ConfigureAwait(false);

            Interlocked.Exchange(ref _shouldFlush, 1);
        }
Example #27
0
        public async Task WriteAsync(ILogItem item)
        {
            EnsureLogFile(FileName);
            if (_sWriter == null)
            {
                return;
            }
            if (!StringBuilderPool.TryPop(out var strBuffer))
            {
                strBuffer = new StringBuilder();
            }
            if (_firstWrite)
            {
                strBuffer.AppendLine();
                strBuffer.AppendLine();
                strBuffer.AppendLine();
                strBuffer.AppendLine();
                strBuffer.AppendLine();
                strBuffer.AppendLine("-.");
                _firstWrite = false;
            }
            strBuffer.Append(item.Timestamp.GetTimeSpanFormat());
            strBuffer.AppendFormat("{0, 11}: ", item.Level);

            if (!string.IsNullOrEmpty(item.GroupName))
            {
                strBuffer.Append(item.GroupName + " - ");
            }

            if (item.LineNumber > 0)
            {
                strBuffer.AppendFormat("<{0};{1:000}> ", string.IsNullOrEmpty(item.TypeName) ? string.Empty : item.TypeName, item.LineNumber);
            }
            else if (!string.IsNullOrEmpty(item.TypeName))
            {
                strBuffer.Append("<" + item.TypeName + "> ");
            }

            if (!string.IsNullOrEmpty(item.Code))
            {
                strBuffer.Append("[" + item.Code + "] ");
            }

            strBuffer.Append(item.Message);

            if (item.Exception != null)
            {
                strBuffer.Append("\r\nExceptions:\r\n");
                GetExceptionDescription(item.Exception, strBuffer);
            }
            var buffer = strBuffer.ToString();

            strBuffer.Clear();
            StringBuilderPool.Push(strBuffer);
            await _sWriter.WriteLineAsync(buffer).ConfigureAwait(false);

            Interlocked.Exchange(ref _shouldFlush, 1);
        }
Example #28
0
        /// <summary>
        /// Creates a tree
        /// </summary>
        /// <param name="data">Database interface</param>
        /// <returns>roots of trees</returns>
        static ILogDirectory[] CreateTree(this IDatabaseInterface data)
        {
            Dictionary <object, IParentSet> dictionary  = new Dictionary <object, IParentSet>();
            IEnumerable <object>            list        = data.Elements;
            List <ILogDirectory>            directories = new List <ILogDirectory>();

            foreach (object o in list)
            {
                ILogItem   item = data[o];
                IParentSet ps   = null;
                if (item is ILogInterval)
                {
                    ps = new LogIntervalWrapper(item as ILogInterval);
                }
                else if (item is ILogData)
                {
                    ps = new LogItemWrapper(item as ILogData);
                }
                else
                {
                    ps = new LogDirectoryWrapper(item);
                }
                dictionary[o] = ps;
            }
            foreach (IParentSet ps in dictionary.Values)
            {
                ILogItem it = (ps as ILogItem);
                object   o  = it.ParentId;
                if (!o.Equals(it.Id))
                {
                    if (dictionary.ContainsKey(o))
                    {
                        ps.Parent = dictionary[o] as ILogItem;
                    }
                }
                if (it is ILogInterval)
                {
                    ILogInterval interval = it as ILogInterval;
                    ILogData     d        = dictionary[interval.DataId] as ILogData;
                    (interval as LogIntervalWrapper).DataSet = d;
                }
            }
            List <ILogDirectory> l = new List <ILogDirectory>();

            foreach (IParentSet ps in dictionary.Values)
            {
                if (ps is ILogDirectory)
                {
                    ILogDirectory item = (ps as ILogDirectory);
                    if (item.Parent == null)
                    {
                        l.Add(item);
                    }
                }
            }
            return(l.ToArray());
        }
Example #29
0
 private void AddToCache(ILogItem item)
 {
     semapore.Wait();
     try { _logCache.Add(item); }
     finally { semapore.Release(); }
     if (_logCache.Count >= _cacheMaxEntries)
     {
         SaveCache();
     }
 }
Example #30
0
        public static void Log(ILogItem item)
        {
            if (item.LogLevel < LogLevelThreshold)
            {
                return;
            }

            _syncListener.WriteLine(item);
            _asyncListener.WriteLine(item);
        }
        /// <summary>
        /// Logs the given message. Output depends on the associated
        /// log4net configuration.
        /// </summary>
        /// <param name="item">A <see cref="ILogItem"/> which encapsulates
        /// information to be logged.</param>
        /// <exception cref="ArgumentNullException">If <paramref name="item"/>
        /// is a null reference.</exception>
        public void Log(ILogItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (!isInitalized)
            {
                Initialize((item.UserIdentity != null)? item.UserIdentity.GetConnectionString():string.Empty);
            }

            item.LoggerName = this.LoggerName;

            switch (item.LogLevel)
            {
            case LogLevel.Fatal:
                if (IsLogLevelEnabled(item.LogLevel))
                {
                    logger.Fatal(item.Message, item.Exception);
                }
                break;

            case LogLevel.Error:
                if (IsLogLevelEnabled(item.LogLevel))
                {
                    logger.Error(item.Message, item.Exception);
                }
                break;

            case LogLevel.Warn:
                if (IsLogLevelEnabled(item.LogLevel))
                {
                    logger.Warn(item.Message, item.Exception);
                }
                break;

            case LogLevel.Info:
                if (IsLogLevelEnabled(item.LogLevel))
                {
                    logger.Info(item.Message, item.Exception);
                }
                break;

            case LogLevel.Debug:
                if (IsLogLevelEnabled(item.LogLevel))
                {
                    logger.Debug(item.Message, item.Exception);
                }
                break;

            default:
                logger.Info(item.Message, item.Exception);
                break;
            }
        }
Example #32
0
 public void WriteLine(ILogItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException(nameof(item));
     }
     if (_filter(item))
     {
         Items.Add(item);
     }
 }
Example #33
0
 /// <summary>
 /// add a new log entry to the dispatcher logger
 /// </summary>
 /// <param name="logItem"></param>
 public override void Log(ILogItem logItem)
 {
     foreach (var o in Loggers)
     {
         o.Log(logItem);
         if (!o.IsForwardEnabled)
         {
             break;
         }
     }
 }
Example #34
0
 public static LogEntity CreateEntity(ILogItem src)
 {
     return(new LogEntity
     {
         PartitionKey = GetPartitionKey(src.ClientId, DateTime.UtcNow),
         ClientId = src.ClientId,
         EventCode = src.EventCode,
         Message = src.Message,
         AccountDelta = src.AccountDelta
     });
 }
Example #35
0
 public static void Log(ILogItem result)
 {
     if (result.LogLevel < LogLevelThreshold) return;
     lock (_sync)
     {
         foreach (var listener in _listeners)
         {
             listener.WriteLine(result);
         }
     }
 }
Example #36
0
 public void WriteLine(ILogItem item)
 {
     if (item.Phase == Phase)
     {
         Items.Add(item);
     }
     else if (item.Phase != null && item.Phase.EndsWith(Phase))
     {
         Items.Add(item);
     }
 }
Example #37
0
        public void WriteLine(ILogItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            var level = item.LogLevel;
            var message = item.Message;
            var phase = item.Phase;
            var file = item.File;
            var line = item.Line;
            if (level < LogLevelThreshold) return;
            var formatter = level + ": ";
            if (!string.IsNullOrEmpty(phase))
            {
                formatter += $"[{phase}]";
            }
            if (!string.IsNullOrEmpty(file))
            {
                string lineInfo = string.Empty;
                if (!string.IsNullOrEmpty(line))
                {
                    lineInfo = $"#L{line}";
                }
                formatter += $"(file:///{file.Replace('\\', '/')}{lineInfo})";
            }

            formatter += message;

            var foregroundColor = Console.ForegroundColor;
            try
            {
                ChangeConsoleColor(level);
                Console.WriteLine(formatter);
            }
            finally
            {
                Console.ForegroundColor = foregroundColor;
            }
        }
Example #38
0
 public ILogItem CreateLogItem(ILogItem logItem)
 {
     return m_mapper.CreateLogItem(logItem.Category, logItem.Event, logItem.Severity, logItem.Incident, logItem.Title, logItem.Message);
 }
 private static IRevision CreateRevision(ILogItem logItem, IssueCollection issues, IRevisionOverride revisionOverride)
 {
     return new Revision(logItem, revisionOverride, issues);
 }
 public void AddLogEntry(ILogItem logItem)
 {
     this.logItems.Add(logItem);
     this.logFileWriter.WriteLine(logItem.ToString());
 }
 public void WriteLine(ILogItem item)
 {
     Logger.Log(item);
 }
Example #42
0
 public static void Decision(ILogItem item, params object[] args)
 {
     observadores.ForEach(observer => observer.Decision(item, args));
 }
Example #43
0
 public static void Paso(ILogItem item, params object[] args)
 {
     observadores.ForEach(observer => observer.Paso(item, args));
 }
Example #44
0
 public Revision(ILogItem logItem, IRevisionOverride userOverride, IIssueCollection issues)
 {
     this.logItem = logItem;
     this.Issues = issues;
     this.UserOverride = userOverride;
 }
Example #45
0
 private void WriteLineCore(ILogItem item)
 {
     foreach (var listener in _listeners)
     {
         listener.WriteLine(item);
     }
 }
Example #46
0
        public void Decision(ILogItem item, params object[] args)
        {
            string mensaje = args.Length > 0 ? string.Format(item.Titulo, args) : item.Titulo;

            Writer.WriteLine(mensaje);
        }
Example #47
0
        public void Paso(ILogItem item, params object[] args)
        {
            string mensaje = args.Length > 0 ? string.Format(item.Descripcion, args) : item.Descripcion;

            Writer.WriteLine(mensaje);
        }
Example #48
0
 public void WriteLine(ILogItem item)
 {
     if (item.LogLevel >= LogLevel.Warning)
     {
         _bmi.WriteLine(item);
     }
 }