Esempio n. 1
0
 /// <summary>
 /// log a specific event with a context message.
 /// </summary>
 public static void Log(FunctionId functionId, LogMessage logMessage)
 {
     if (TryGetActiveLogger(functionId, out var logger))
     {
         logger.Log(functionId, logMessage);
         logMessage.Free();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// log a specific event with a context message.
        /// </summary>
        public static void Log(FunctionId functionId, LogMessage logMessage)
        {
            var logger = GetLogger();

            if (logger == null)
            {
                return;
            }

            if (!logger.IsEnabled(functionId))
            {
                return;
            }

            logger.Log(functionId, logMessage);
            logMessage.Free();
        }
Esempio n. 3
0
            public void Dispose()
            {
                if (_logger == null)
                {
                    return;
                }

                // This delta is valid for durations of < 25 days
                var delta = Environment.TickCount - _tick;

                _logger.LogBlockEnd(_functionId, _logMessage, _blockId, delta, _cancellationToken);

                // Free this block back to the pool
                _logMessage.Free();
                _logMessage        = null;
                _logger            = null;
                _cancellationToken = default;

                _pool.Free(this);
            }
Esempio n. 4
0
            public void Dispose()
            {
                if (logger == null)
                {
                    return;
                }

                // This delta is valid for durations of < 25 days
                var delta = Environment.TickCount - this.tick;

                logger.LogBlockEnd(functionId, logMessage, blockId, delta, cancellationToken);

                // Free this block back to the pool
                logMessage.Free();
                logMessage        = null;
                logger            = null;
                cancellationToken = default(CancellationToken);

                pool.Free(this);
            }