当前位置: 首页>>代码示例>>C#>>正文


C# ILogger.Indent方法代码示例

本文整理汇总了C#中ILogger.Indent方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.Indent方法的具体用法?C# ILogger.Indent怎么用?C# ILogger.Indent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILogger的用法示例。


在下文中一共展示了ILogger.Indent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterBundles

    /// <summary>
    /// Registers the bundles.
    /// </summary>
    /// <param name="bundles">The bundles.</param>
    /// <param name="logger">The logger.</param>
    public static void RegisterBundles(BundleCollection bundles, ILogger logger)
    {
      logger.LogDebug("START: ModuleConfig.RegisterBundles");
      try
      {
        logger.Indent();
        logger.LogDebug("GetViewModules");
        var vModules = MEFConfig.Container.GetExports<IViewModule>();

        // process each module
        logger.LogDebug("Iterating ViewModules");
        logger.Indent();
        foreach (var module in vModules)
        {
          // get the non lazy module value
          var mod = module.Value; // as IViewModule;

          if (mod != null)
          {
            // add any bundles the module may need
            mod.RegisterBundles(bundles);
          }

          logger.LogDebug(mod.GetType().FullName);
        }
        logger.UnIndent();

      }
      finally
      {
        logger.UnIndent();
        logger.LogDebug("END: ModuleConfig.RegisterBundles");
      }
    }
开发者ID:Jonesie,项目名称:Jonesie.Web,代码行数:39,代码来源:ModuleConfig.cs

示例2: Application_Start

    /// <summary>
    /// Start the Application.
    /// </summary>
    protected void Application_Start()
    {
      System.Diagnostics.Trace.WriteLine("{0} :: Application Starting".FormatWith(DateTime.Now.ToString("HH:mm:ss.ff")));

      // MEF will load all the modules from the specified path.
      // Currently this is just the normal bin folder as having them
      // anywhere else can cause problems for the views
      System.Diagnostics.Trace.WriteLine("{0} ::  Initialising MEF".FormatWith(DateTime.Now.ToString("HH:mm:ss.ff")));
      MEFConfig.RegisterMEF(this, Server.MapPath(@"~\bin\"));

      _logger = MEFConfig.Container.GetExport<ILogger>().Value;
      _settings = MEFConfig.Container.GetExport<ISettings>().Value;

      // once mef is configured we can check the database
      CheckDatabase();

      _logger.Indent();
      try
      {
        _logger.LogDebug("Configuring View Engine");
        // Setup a custom view engine.
        // This knows how to deal with views in module folders.
        ViewEngines.Engines.Clear();

        // WARNING!!! Helpers assume that JonesieViewEngine is the first index in the ViewEngines array!!! Changing this
        // will break a lot of things.
        ViewEngines.Engines.Add(new JonesieViewEngine(MEFConfig.Container.GetExports<IViewModule>()));

        // Just the usual MVC startup fluff
        AreaRegistration.RegisterAllAreas();
        AuthConfig.RegisterAuth(_settings);
        WebApiConfig.Register(GlobalConfiguration.Configuration);
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

        // need to map the SignalR hub early
        RouteTable.Routes.MapHubs();

        // register routes for service and view modules and bundles for view modules
        ModuleConfig.RegisterRoutes(RouteTable.Routes, GlobalConfiguration.Configuration.Routes, _logger);
        ModuleConfig.RegisterBundles(BundleTable.Bundles, _logger);

        // now that everything else is done we can tell the modules to go ahead and get ready 
        ModuleConfig.InitialiseModules(_logger);

        // register the default routes and bundle after the modules
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);

        // we need to do this early so we can use IsInRole for security trimming the menus
        _logger.LogDebug("Initialising Web Security");
        WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", false);
      }
      finally
      {
        _logger.UnIndent();
      }

      _logger.LogDebug("Application Started");
    }
开发者ID:Jonesie,项目名称:Jonesie.Web,代码行数:62,代码来源:Global.asax.cs

示例3: RegisterRoutes

    /// <summary>
    /// Registers the routes.
    /// </summary>
    /// <param name="viewRoutes">The view routes.</param>
    /// <param name="apiRoutes">The API routes.</param>
    /// <param name="logger">The logger.</param>
    public static void RegisterRoutes(RouteCollection viewRoutes, HttpRouteCollection apiRoutes, ILogger logger)
    {

      logger.LogDebug("START: ModuleConfig.RegisterRoutes");
      try
      {
        logger.Indent();

        logger.LogDebug("GetViewModules");
        var vModules = MEFConfig.Container.GetExports<IViewModule>();
        logger.LogDebug("GetServiceModules");
        var sModules = MEFConfig.Container.GetExports<IServiceModule>();

        logger.LogDebug("Iterating ViewModules");
        logger.Indent();
        foreach (var module in vModules)
        {
          var mod = module.Value;
          mod.RegisterRoutes(viewRoutes);

          logger.LogDebug(mod.GetType().FullName);
        }
        logger.UnIndent();

        logger.LogDebug("Iterating ServiceModules");
        logger.Indent();
        foreach (var module in sModules)
        {
          var mod = module.Value;
          mod.RegisterRoutes(apiRoutes);

          logger.LogDebug(mod.GetType().FullName);
        }
        logger.UnIndent();
      }
      finally
      {
        logger.UnIndent();
        logger.LogDebug("END: ModuleConfig.RegisterRoutes");
      }
    }
开发者ID:Jonesie,项目名称:Jonesie.Web,代码行数:47,代码来源:ModuleConfig.cs

示例4: InitialiseModules

    /// <summary>
    /// Initialises the modules internals.
    /// </summary>
    /// <param name="logger">The logger.</param>
    public static void InitialiseModules(ILogger logger)
    {
      logger.LogDebug("START: ModuleConfig.InitialiseModules");
      try
      {
        logger.Indent();
        logger.LogDebug("GetModules");

        var modules = MEFConfig.Container.GetExports<IServiceModule>().Select(m => (IModule)(m.Value))
                    .Union(
                        MEFConfig.Container.GetExports<IViewModule>().Select(m => (IModule)(m.Value))
                    );

        // process each module
        logger.LogDebug("Iterating Modules");
        logger.Indent();
        foreach (var module in modules)
        {
          // get the non lazy module value
          if (module != null)
          {
            module.InternalInit();
          }

          logger.LogDebug(module.GetType().FullName);
        }
        logger.UnIndent();
      }
      finally
      {
        logger.UnIndent();
        logger.LogDebug("END: ModuleConfig.InitialiseModules");
      }
    }
开发者ID:Jonesie,项目名称:Jonesie.Web,代码行数:38,代码来源:ModuleConfig.cs


注:本文中的ILogger.Indent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。