Ejemplo n.º 1
0
        /// <summary>Create a new logger chaining the given loggers together.</summary>
        /// <remarks>Create a new logger chaining the given loggers together.</remarks>
        /// <param name="loggers">loggers to execute, in order.</param>
        /// <returns>a new logger chain of the given loggers.</returns>
        public static UploadPackLogger NewChain <_T0>(IList <_T0> loggers) where _T0 : UploadPackLogger
        {
            UploadPackLogger[] newLoggers = new UploadPackLogger[loggers.Count];
            int i = 0;

            foreach (UploadPackLogger logger in loggers)
            {
                if (logger != UploadPackLogger.NULL)
                {
                    newLoggers[i++] = logger;
                }
            }
            if (i == 0)
            {
                return(UploadPackLogger.NULL);
            }
            else
            {
                if (i == 1)
                {
                    return(newLoggers[0]);
                }
                else
                {
                    return(new NGit.Transport.UploadPackLoggerChain(newLoggers, i));
                }
            }
        }
Ejemplo n.º 2
0
		/// <summary>Set the logger.</summary>
		/// <remarks>Set the logger.</remarks>
		/// <param name="logger">the logger instance. If null, no logging occurs.</param>
		public virtual void SetLogger(UploadPackLogger logger)
		{
			this.logger = logger;
		}
Ejemplo n.º 3
0
 /// <summary>Set the logger.</summary>
 /// <remarks>Set the logger.</remarks>
 /// <param name="logger">the logger instance. If null, no logging occurs.</param>
 public virtual void SetLogger(UploadPackLogger logger)
 {
     this.logger = logger;
 }