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;
 }
Exemple #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;
        }
Exemple #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());
     }
 }
 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();
     }
 }
Exemple #5
0
 public void SetHandler(TraceHandler handler)
 {
     Handler = handler;
 }
Exemple #6
0
 public void SetHandler(TraceHandler handler)
 {
 }
Exemple #7
0
 public void SetHandler(TraceHandler handler)
 {
     Handler = handler;
 }
 public void SetHandler(TraceHandler handler)
 {
     
 }