12 #ifndef WIN32 // Goober5000
33 #define MAX_LINE_WIDTH 128
74 fp = fopen(pathname,
"rt");
81 OutwndFilter.push_back( new_filter );
85 OutwndFilter.push_back( new_filter );
89 OutwndFilter.push_back( new_filter );
100 else if (*inbuf ==
'-')
105 z = strlen(inbuf) - 1;
106 if (inbuf[z] ==
'\n')
114 }
else if ( !
stricmp(new_filter.
name,
"general") ) {
116 }
else if ( !
stricmp(new_filter.
name,
"warning") ) {
120 OutwndFilter.push_back( new_filter );
123 if ( ferror(fp) && !feof(fp) )
124 nprintf((
"Error",
"Error reading \"%s\"\n", pathname));
143 fp = fopen(pathname,
"wt");
146 for (
uint i = 0;
i < OutwndFilter.size();
i++)
147 fprintf(fp,
"%c%s\n", OutwndFilter[
i].
enabled ?
'+' :
'-', OutwndFilter[
i].
name);
161 va_start(args, format);
173 if ( (
id == NULL) || (format == NULL) )
176 va_start(args, format);
187 if ( (
id == NULL) || (tmp == NULL) )
191 fputs(
"outwnd not initialized yet... \n", stdout);
201 outwnd_print(
"general",
"==========================================================================\n" );
202 outwnd_print(
"general",
"DEBUG SPEW: No debug_filter.cfg found, so only general, error, and warning\n" );
203 outwnd_print(
"general",
"categories can be shown and no debug_filter.cfg info will be saved.\n" );
204 outwnd_print(
"general",
"==========================================================================\n" );
207 for (i = 0; i < OutwndFilter.size(); i++) {
213 if ( i == OutwndFilter.size() ) {
224 OutwndFilter.push_back( new_filter );
228 if ( !OutwndFilter[i].
enabled )
262 Log_fp = fopen(pathname,
"wb");
267 time_t timedate = time(NULL);
270 memset( datestr, 0,
sizeof(datestr) );
271 strftime( datestr,
sizeof(datestr)-1,
"%a %b %d %H:%M:%S %Y", localtime(&timedate) );
273 printf(
"Future debug output directed to: %s\n", pathname);
274 outwnd_printf(
"General",
"Opened log '%s', %s ...\n", pathname, datestr);
282 time_t timedate = time(NULL);
285 memset( datestr, 0,
sizeof(datestr) );
286 strftime( datestr,
sizeof(datestr)-1,
"%a %b %d %H:%M:%S %Y", localtime(&timedate) );
302 va_start(args, format);
316 #endif // Goober5000 - #ifndef WIN32
GLenum GLsizei GLenum format
int Log_debug_output_to_file
void outwnd_printf2(const char *format,...)
const char * Osreg_user_dir
void outwnd_printf(const char *id, const char *format,...)
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
const char * detect_home(void)
void save_filter_info(void)
void vsprintf(SCP_string &dest, const char *format, va_list ap)
GLenum GLenum GLsizei const GLuint GLboolean enabled
cf_pathtype Pathtypes[CF_MAX_PATH_TYPES]
SCP_vector< outwnd_filter_struct > OutwndFilter
void safe_point(const char *file, int line, const char *format,...)
char * FreeSpace_logfilename
void safe_point_print(const char *format,...)
GLuint const GLchar * name
void load_filter_info(void)
ubyte Outwnd_no_filter_file
void outwnd_print(const char *id=NULL, const char *temp=NULL)
GLsizei const GLchar ** path
void outwnd_init(int display_under_freespace_window)