コード例 #1
0
        /// <summary>
        /// Initialises an instance of the <see cref="LogContainer"/> class.
        /// </summary>
        /// <param name="items">
        /// The items to populate the container with.
        /// </param>
        public LogContainer(LogEntry[] items) : this()
        {
            items.ShouldNotBeNull();

            foreach (var item in items)
            {
                m_Count = AddLogEntry(item);
            }
        }
コード例 #2
0
        /// <summary>
        /// See <see cref="ILogProvider.Log"/> for more details.
        /// </summary>
        /// <param name="entry">
        /// The logging entry to add.
        /// </param>
        public void Log(LogEntry entry)
        {
            entry.ShouldNotBeNull();

            entry.SetLoggerName(m_LoggerName);
            if (IsLoggingEnabled)
            {
                m_LogContainer.AddLogEntry(entry);
            }
        }
コード例 #3
0
        /// <summary>
        /// Adds a new logging entry to the proxy service.
        /// </summary>
        /// <remarks>
        /// Will add a new log entry in a thread safe manner.
        /// </remarks>
        /// <param name="logEntry">
        /// The log entry to add.
        /// </param>
        public void AddLogEntry(LogEntry logEntry)
        {
            logEntry.ShouldNotBeNull();

            var count = m_LogEntries.AddLogEntry(logEntry);
            if (count >= m_BatchSize)
            {
                SignalWorkToBeDone();
            }
        }