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


C# IAppender类代码示例

本文整理汇总了C#中IAppender的典型用法代码示例。如果您正苦于以下问题:C# IAppender类的具体用法?C# IAppender怎么用?C# IAppender使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: InitAppenders

 private void InitAppenders(IAppender[] appenders)
 {
     for (int i = 0; i < appenders.Length; i++)
     {
         this.appenders[i] = appenders[i];
     }
 }
开发者ID:pavelilchev,项目名称:HomeWorks,代码行数:7,代码来源:Logger.cs

示例2: AddAppender

		/// <summary>
		/// Add an appender to a logger.
		/// </summary>
		/// <param name="loggerName">Name of the logger.</param>
		/// <param name="appender">The appender.</param>
		public static void AddAppender( string loggerName, IAppender appender )
		{
			ILog log = LogManager.GetLogger( loggerName );
			var l = (Logger)log.Logger;

			l.AddAppender( appender );
		}
开发者ID:ChrisEdwards,项目名称:Fluency,代码行数:12,代码来源:Log4NetConfiguration.cs

示例3: AddAppender

        public void AddAppender(IAppender appender)
        {
            Hierarchy hierarchy =
                    (Hierarchy)LogManager.GetRepository();

            hierarchy.Root.AddAppender(appender);
        }
开发者ID:dionata,项目名称:wfmvc,代码行数:7,代码来源:Logger.cs

示例4: Configure

        /// <summary>
        /// Configures logging to a specified level, optionally directing log output to a particular
        /// IAppender instance.
        /// </summary>
        /// <param name="verbose">If true, informational messages should be logged.</param>
        /// <param name="debug">If true, diagnostic and trace-level messages should be logged.</param>
        /// <param name="appender">An IAppender to which log traffic should be directed. If absent, a default
        /// is used.</param>
        public static void Configure(bool verbose, bool debug, IAppender appender = null)
        {
            if (appender != null)
            {
                BasicConfigurator.Configure(appender);
            }
            else
            {
                // Just take the default
                BasicConfigurator.Configure();
            }

            var hierarchy = log4net.LogManager.GetRepository() as log4net.Repository.Hierarchy.Hierarchy;

            if (debug)
            {
                hierarchy.Root.Level = log4net.Core.Level.Debug;
            }
            else if (verbose)
            {
                hierarchy.Root.Level = log4net.Core.Level.Info;
            }
            else
            {
                hierarchy.Root.Level = log4net.Core.Level.Error;
            }
        }
开发者ID:Pablissimo,项目名称:nrconfig,代码行数:35,代码来源:LogConfigurator.cs

示例5: AddAppenders

 private void AddAppenders(IAppender[] appenders)
 {
     foreach (IAppender appender in appenders)
     {
         this.Appenders.Add(appender);
     }
 }
开发者ID:msmilkoff,项目名称:HighQualityCodeHomeworks,代码行数:7,代码来源:Logger.cs

示例6: Logger

 public Logger(IAppender appender, IAppender appenderTwo, IAppender appenderThree)
 {
     this.appenders = new List<IAppender>();
     this.Appenders = appender;
     this.Appenders = appenderTwo;
     this.Appenders = appenderThree;
 }
开发者ID:ivayloivanof,项目名称:HQC,代码行数:7,代码来源:Logger.cs

示例7: AddAppender

        /*
        public static ILog MyLogger {
            get {
                return LogManager.GetLogger(MyLoggerName);
            }
        }
        */

        private static void AddAppender(string loggerName, IAppender appender) {
            var log = LogManager.GetLogger(loggerName);
            var logger = (Logger)log.Logger;

            logger.AddAppender(appender);
            logger.Repository.Configured = true;
        }
开发者ID:akondrahman,项目名称:SrcML.NET,代码行数:15,代码来源:SrcMLFileLogger.cs

示例8: SetAppenderFixFlags

 private void SetAppenderFixFlags(IAppender appender)
 {
     var bufferingAppender = appender as BufferingAppenderSkeleton;
     if (bufferingAppender != null)
     {
         bufferingAppender.Fix = Fix;
     }
 }
开发者ID:stuartd,项目名称:Log4Net.Async,代码行数:8,代码来源:AsyncForwardingAppenderBase.cs

示例9: AddAppender

 public static void AddAppender(IAppender initAppender)
 {
     appender.Add(initAppender);
     foreach (ILog aLog in log)
     {
         ((Log)aLog).AddAppender(initAppender);
     }
 }
开发者ID:ThomasMentzel,项目名称:SlideShareCode,代码行数:8,代码来源:LogManager.cs

示例10: Logger

 public Logger(IAppender baseapender, params IAppender[] moreappenders)
 {
     this.Appenders = new List<IAppender>();
     this.Appenders.Add(baseapender);
     foreach (var appender in moreappenders)
     {
         this.Appenders.Add(appender);
     }
 }
开发者ID:EBojilova,项目名称:SoftUni-3,代码行数:9,代码来源:Logger.cs

示例11: FallbackAppenderProxyBase

        public FallbackAppenderProxyBase(IAppender appenderToWrap)
        {
            var convertedAppender = appenderToWrap as AppenderSkeleton;
            if (convertedAppender == null)
                throw new InvalidOperationException("cannot use IndefiniteAppenderProxy with an appender that does not inherit from AppenderSkeleton as it needs to hook into the IErrorHandler, to gather errors.");

            innerAppender = convertedAppender;
            errorHandler = new RecordingErrorHandler(GetType().Name);
            convertedAppender.ErrorHandler = errorHandler;
        }
开发者ID:traktraktrugui,项目名称:log4netcontrib,代码行数:10,代码来源:FallbackAppenderProxyBase.cs

示例12: AddAppender

        public void AddAppender(IAppender appender)
        {
            int size = this.Appenders.Length;
            int newSize = size + 1;

            IAppender[] tmp = new IAppender[newSize];
            Array.Copy(this.Appenders, 0, tmp, 0, size);

            this.Appenders = tmp;

            this.Appenders[newSize - 1] = appender;
        }
开发者ID:nikolay-dimitrov,项目名称:SoftUniHomeWorks,代码行数:12,代码来源:AbstractLogger.cs

示例13: addLogAppender

        public static void addLogAppender(IAppender appender)
        {
            if (appender == null)
            {
                string msg = UException.getExceptionMessage("AppGlobal", "addLogAppender", "An IAppender object is required");

                logAndThrowException(new ArgumentNullException(msg), msg);
            }

            loadLoggers();

            log4net.Repository.Hierarchy.Logger log = (log4net.Repository.Hierarchy.Logger)logger.Logger;

            log.AddAppender(appender);
        }
开发者ID:kevinvw,项目名称:HubSpot2014,代码行数:15,代码来源:AppGlobal.cs

示例14: AddAppender

        protected virtual void AddAppender(IAppender profilerAppender, IAppenderAttachable logger)
        {
            IAppender appender;
            do {
                appender = logger.GetAppender(profilerAppender.Name);
                if (appender != null) {
                    try {
                        logger.RemoveAppender(appender);
                    }
                    catch (Exception) { }
                }
            }
            while (appender != null);

            logger.AddAppender(profilerAppender);
        }
开发者ID:lozanotek,项目名称:LeanNH,代码行数:16,代码来源:Logger.cs

示例15: AddAppender

		/// <summary>
		/// Attaches an appender.
		/// </summary>
		/// <param name="newAppender">The appender to add.</param>
		/// <remarks>
		/// If the appender is already in the list it won't be added again.
		/// </remarks>
		public void AddAppender(IAppender newAppender) 
		{
			// Null values for newAppender parameter are strictly forbidden.
			if (newAppender == null)
			{
				throw new ArgumentNullException("newAppender");
			}
	
			if (m_appenderList == null) 
			{
				m_appenderList = new AppenderCollection(1);
			}
			if (!m_appenderList.Contains(newAppender))
			{
				m_appenderList.Add(newAppender);
			}
		}
开发者ID:WolfeReiter,项目名称:clamav-csharp-client,代码行数:24,代码来源:AppenderAttachedImpl.cs


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