119 HANDLE H= GetStdHandle(STD_OUTPUT_HANDLE);
123 WORD actualAttributes;
125 CONSOLE_SCREEN_BUFFER_INFO info;
126 GetConsoleScreenBufferInfo( H, &info );
127 actualAttributes= info.wAttributes;
129 WORD previousAttributes= actualAttributes;
145 #if !ALIB_CHARACTERS_WIDE
146 WriteConsoleA( H, actual.
Buffer(), (DWORD) actual.
Length(), &ignore, NULL );
148 WriteConsoleW( H, actual.
Buffer(), (DWORD) actual.
Length(), &ignore, NULL );
160 bool isForeGround=
true;
161 if( c ==
'C' || c ==
'c' )
163 isForeGround= c==
'c';
170 WORD light=
CFP.
LCU!= ColorfulLoggerParameters::LightColorUsage::Never
171 && ((
CFP.
LCU== ColorfulLoggerParameters::LightColorUsage::Foreground)
173 ? FOREGROUND_INTENSITY
177 if ( colNo >= 0 && colNo < 6) attr= (win32Cols[colNo] | light);
179 else if ( colNo == 6 ) attr= W32C_BLACK;
180 else if ( colNo == 7 ) attr= W32C_WHITE;
181 else if ( colNo == 8 ) attr= light ? W32C_GRAY_LIGHT : W32C_GRAY_DARK;
189 actualAttributes= isForeGround ? ( actualAttributes & W32C_FOREGROUND_MASK ) | attr
190 : ( actualAttributes & W32C_BACKGROUND_MASK ) | (attr << 4);
204 else if ( c ==
't' || c ==
'A' )
207 int extraSpace= c >=
'0' && c <=
'9' ? (int) ( c -
'0' )
208 : (int) ( c -
'A' ) + 10;
213 integer qtySpaces= tabStop - column;
218 while (qtySpaces >= spaces.Length() ) {
219 WriteConsoleA( H, spaces.Buffer(), (DWORD) spaces.Length(), &ignore, NULL );
220 qtySpaces-= spaces.Length();
223 WriteConsoleA( H, spaces.Buffer(), (DWORD) qtySpaces, &ignore, NULL );
232 actualAttributes= ( actualAttributes & W32C_FOREGROUND_MASK )
234 | (
CFP.
LCU == ColorfulLoggerParameters::LightColorUsage::Foreground
235 ? FOREGROUND_INTENSITY
244 ALIB_WARNING(
"ALOX",
"WindowsConsoleLogger: Unknown ESC code" );
255 std::cout << std::endl;
Variable varFormatAutoSizes
Variable varFormatMetaInfo
virtual ALIB_API void AcknowledgeLox(detail::LoxImpl *lox, lang::ContainerOp op) override
This namespaces defines class TextLogger and its helpers.
Parameters specific to colorful loggers. As of today, this simply has one attribute.