Ejemplo n.º 1
0
        /// <summary>
        /// Traces the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="arguments">The arguments.</param>
        public static void Trace(string message, params object[] arguments)
        {
            var current = CurrentTraceBlock;

            if (current == null)
            {
                //No block in current scope, create temporary new one.
                using (current = TraceBlock.New())
                {
                    current.Trace(message, arguments);
                }
            }
            else
            {
                //Trace to block in scope.
                current.Trace(message, arguments);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <returns></returns>
 public static ITraceBlock CreateBlock()
 {
     return(TraceBlock.New());
 }