logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1197625 - /logging/log4net/trunk/src/Appender/AnsiColorTerminalAppender.cs
Date Fri, 04 Nov 2011 16:17:15 GMT
Author: bodewig
Date: Fri Nov  4 16:17:15 2011
New Revision: 1197625

URL: http://svn.apache.org/viewvc?rev=1197625&view=rev
Log:
Support for "light" colors i n AnsiColorTerminalAppender.  LOG4NET-223.  Submitted by Bojan

Modified:
    logging/log4net/trunk/src/Appender/AnsiColorTerminalAppender.cs

Modified: logging/log4net/trunk/src/Appender/AnsiColorTerminalAppender.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Appender/AnsiColorTerminalAppender.cs?rev=1197625&r1=1197624&r2=1197625&view=diff
==============================================================================
--- logging/log4net/trunk/src/Appender/AnsiColorTerminalAppender.cs (original)
+++ logging/log4net/trunk/src/Appender/AnsiColorTerminalAppender.cs Fri Nov  4 16:17:15 2011
@@ -153,7 +153,12 @@ namespace log4net.Appender
 			/// <summary>
 			/// text is displayed with a strikethrough
 			/// </summary>
-			Strikethrough	= 64
+			Strikethrough		= 64,
+
+			/// <summary>
+			/// text color is light
+			/// </summary>
+			Light			= 128
 		}
 
 		/// <summary>
@@ -176,7 +181,7 @@ namespace log4net.Appender
 			/// <summary>
 			/// color is red
 			/// </summary>
-			Red		= 1,
+			Red	= 1,
 
 			/// <summary>
 			/// color is green
@@ -510,12 +515,14 @@ namespace log4net.Appender
 				// Reset any existing codes
 				buf.Append("\x1b[0;");
 
+				int lightAdjustment = ((m_attributes & AnsiAttributes.Light) > 0) ? 60 : 0;
+				
 				// set the foreground color
-				buf.Append(30 + (int)m_foreColor);
+				buf.Append(30 + lightAdjustment + (int)m_foreColor);
 				buf.Append(';');
 
 				// set the background color
-				buf.Append(40 + (int)m_backColor);
+				buf.Append(40 + lightAdjustment + (int)m_backColor);
 
 				// set the attributes
 				if ((m_attributes & AnsiAttributes.Bright) > 0)



Mime
View raw message