47 my->console_handle = INVALID_HANDLE_VALUE;
49 my->cfg = console_appender_config;
52 my->console_handle = GetStdHandle(STD_ERROR_HANDLE);
54 my->console_handle = GetStdHandle(STD_OUTPUT_HANDLE);
59 for(
auto itr = my->cfg.level_colors.begin(); itr != my->cfg.level_colors.end(); ++itr )
60 my->lc[itr->level] = itr->color;
102 std::string file_line =
context.get_file().substr( 0, 22 );
108 if(my->use_syslog_header) {
128 line +=
fixed_size( 29, file_line ); line +=
' ';
130 auto me =
context.get_method();
134 for(
uint32_t i = 0;i < me.size(); ++i ) {
135 if( me[i] ==
':' )
p = i;
138 if( me[
p] ==
':' ) ++
p;
146 fprintf( out,
"\n" );
148 if( my->cfg.flush ) fflush( out );
156 if (my->console_handle != INVALID_HANDLE_VALUE)
157 SetConsoleTextAttribute(my->console_handle, get_console_color(text_color));
159 if(isatty(fileno(out))) fprintf( out,
"%s", get_console_color( text_color ) );
163 fprintf( out,
"%s", text.c_str() );
166 if (my->console_handle != INVALID_HANDLE_VALUE)
167 SetConsoleTextAttribute(my->console_handle, CONSOLE_DEFAULT);
169 if(isatty(fileno(out))) fprintf( out,
"%s", CONSOLE_DEFAULT );
172 if( my->cfg.flush ) fflush( out );
provides information about where and when a log message was generated.
log_level get_log_level() const
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.