/// <summary> /// Weaves the logging and tracing into the given module. Please note that the module itself is modified. /// Configuration is used to specify certain weaving behaviors and provide necessary input for the weaver /// </summary> /// <param name="configuration">Configuration information</param> /// <param name="moduleDefinition">Target module</param> public static void Execute(TraceLoggingConfiguration configuration, ModuleDefinition moduleDefinition) { try { WeavingLog.LogInfo("Tracer: Starts weaving."); Stopwatch timer = Stopwatch.StartNew(); ModuleLevelWeaver weaver = new ModuleLevelWeaver(configuration, moduleDefinition); weaver.InternalExecute(); timer.Stop(); WeavingLog.LogInfo(string.Format("Tracer: Weaving done in {0} ms.", timer.ElapsedMilliseconds)); } catch (Exception ex) { WeavingLog.LogError(string.Format("Tracer: Weaving failed with {0}", ex)); throw; } }
/// <summary> /// Weaves the logging and tracing into the given module. Please note that the module itself is modified. /// Configuration is used to specify certain weaving behaviors and provide necessary input for the weaver /// </summary> /// <param name="configuration">Configuration information</param> /// <param name="moduleDefinition">Target module</param> public static void Execute(TraceLoggingConfiguration configuration, ModuleDefinition moduleDefinition) { try { WeavingLog.LogInfo("Tracer: Starts weaving."); var timer = Stopwatch.StartNew(); var weaver = new ModuleLevelWeaver(configuration, moduleDefinition); weaver.InternalExecute(); timer.Stop(); WeavingLog.LogInfo(String.Format("Tracer: Weaving done in {0} ms.", timer.ElapsedMilliseconds)); } catch (Exception ex) { WeavingLog.LogError(String.Format("Tracer: Weaving failed with {0}", ex)); throw; } }