logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject cvs commit: logging-log4net/src/Appender RemoteSyslogAppender.cs
Date Sun, 19 Dec 2004 19:22:25 GMT
nicko       2004/12/19 11:22:25

  Modified:    src/Appender RemoteSyslogAppender.cs
  Log:
  Updates suggested by FxCop.
  Minor naming changes to internal types.
  Perf improvements to type check + type cast code.
  
  Revision  Changes    Path
  1.5       +14 -1     logging-log4net/src/Appender/RemoteSyslogAppender.cs
  
  Index: RemoteSyslogAppender.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Appender/RemoteSyslogAppender.cs,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteSyslogAppender.cs	22 Nov 2004 02:09:06 -0000	1.4
  +++ RemoteSyslogAppender.cs	19 Dec 2004 19:22:25 -0000	1.5
  @@ -469,7 +469,20 @@
   		/// </remarks>
   		public static int GeneratePriority(SyslogFacility facility, SyslogSeverity severity)
   		{
  -			return ((int)facility * 8) + (int)severity;
  +			if (facility < SyslogFacility.Kernel || facility > SyslogFacility.Local7)
  +			{
  +				throw new ArgumentException("SyslogFacility out of range", "facility");
  +			}
  +
  +			if (severity < SyslogSeverity.Emergency || severity > SyslogSeverity.Debug)
  +			{
  +				throw new ArgumentException("SyslogSeverity out of range", "severity");
  +			}
  +
  +			unchecked
  +			{
  +				return ((int)facility * 8) + (int)severity;
  +			}
   		}
   
   		#endregion Public Static Members
  
  
  

Mime
View raw message