Example #1
0
 public static void SetNoTrace()
 {
     var handler = ContainerFactory.Current.Resolve(typeof(TraceHandler), Scope.Context) as TraceHandler;
     if (handler == null)
     {
         //if (DoLogging) Logging.DebugMessage("Creating new trace handler for {0}.{1}", taskName, methodName);
         handler = new TraceHandler();
         ContainerFactory.Current.Bind(typeof(TraceHandler), handler, Scope.Context);
     }
     handler.NoTrace = true;
 }
Example #2
0
        public static void SetNoTrace()
        {
            var handler = ContainerFactory.Current.Resolve(typeof(TraceHandler), Scope.Context) as TraceHandler;

            if (handler == null)
            {
                //if (DoLogging) Logging.DebugMessage("Creating new trace handler for {0}.{1}", taskName, methodName);
                handler = new TraceHandler();
                ContainerFactory.Current.Bind(typeof(TraceHandler), handler, Scope.Context);
            }
            handler.NoTrace = true;
        }
Example #3
0
 public static ITracer StartTracer(object callingInstance, string taskName, string methodName)
 {
     try
     {
         if (DoLogging)
         {
             Logging.DebugMessage("Current sync context: {0}", SynchronizationContext.Current);
             if (!(SynchronizationContext.Current is ThreadSynchronizationContext))
             {
                 Logging.DebugMessage("not in stardust synchronized mode...");
             }
         }
         ITracer newTracer;
         var     handler = ContainerFactory.Current.Resolve(typeof(TraceHandler), Scope.Context) as TraceHandler;
         if (handler == null)
         {
             if (DoLogging)
             {
                 Logging.DebugMessage("Creating new trace handler for {0}.{1}", taskName, methodName);
             }
             handler = new TraceHandler();
             ContainerFactory.Current.Bind(typeof(TraceHandler), handler, Scope.Context);
         }
         if (handler.NoTrace)
         {
             return(NullTracer.Shared);
         }
         if (handler.RootTracer.IsNull())
         {
             handler.RootTracer    = new Tracer();
             newTracer             = handler.RootTracer;
             handler.CurrentTracer = newTracer;
         }
         else
         {
             newTracer             = handler.CurrentTracer.CreateChildTracer();
             handler.CurrentTracer = newTracer;
         }
         newTracer.SetHandler(handler);
         return(newTracer.StartTrace(taskName, methodName));
     }
     catch (Exception)
     {
         return(new NullTracer());
     }
 }
Example #4
0
 public static ITracer StartTracer(object callingInstance, string taskName, string methodName)
 {
     try
     {
         if (DoLogging)
         {
             Logging.DebugMessage("Current sync context: {0}", SynchronizationContext.Current);
             if (!(SynchronizationContext.Current is ThreadSynchronizationContext))
                 Logging.DebugMessage("not in stardust synchronized mode...");
         }
         ITracer newTracer;
         var handler = ContainerFactory.Current.Resolve(typeof(TraceHandler), Scope.Context) as TraceHandler;
         if (handler == null)
         {
             if (DoLogging) Logging.DebugMessage("Creating new trace handler for {0}.{1}", taskName, methodName);
             handler = new TraceHandler();
             ContainerFactory.Current.Bind(typeof(TraceHandler), handler, Scope.Context);
         }
         if (handler.NoTrace) return NullTracer.Shared;
         if (handler.RootTracer.IsNull())
         {
             handler.RootTracer = new Tracer();
             newTracer = handler.RootTracer;
             handler.CurrentTracer = newTracer;
         }
         else
         {
             newTracer = handler.CurrentTracer.CreateChildTracer();
             handler.CurrentTracer = newTracer;
         }
         newTracer.SetHandler(handler);
         return newTracer.StartTrace(taskName, methodName);
     }
     catch (Exception)
     {
         return new NullTracer();
     }
 }
Example #5
0
 public void SetHandler(TraceHandler handler)
 {
     Handler = handler;
 }
Example #6
0
 public void SetHandler(TraceHandler handler)
 {
 }
Example #7
0
 public void SetHandler(TraceHandler handler)
 {
     Handler = handler;
 }
Example #8
0
 public void SetHandler(TraceHandler handler)
 {
     
 }