Only enable stdout/stderr log output after main initialisation

* This suppresses lines like "RenderDoc v0.31 x64 (...) loaded in replay
  application" which are only useful for the logfile and not for actual
  user output.
This commit is contained in:
baldurk
2016-08-25 12:42:08 +02:00
parent bbcc9960ee
commit ced197abe3
3 changed files with 16 additions and 2 deletions
+9 -2
View File
@@ -272,6 +272,13 @@ void rdclog_filename(const char *filename)
logfile() = filename;
}
static bool log_output_enabled = false;
void rdclog_enableoutput()
{
log_output_enabled = true;
}
void rdclog_flush()
{
}
@@ -287,12 +294,12 @@ void rdclogprint_int(LogType type, const char *fullMsg, const char *msg)
#endif
#if defined(OUTPUT_LOG_TO_STDOUT)
// don't output debug messages to stdout/stderr
if(type != RDCLog_Debug)
if(type != RDCLog_Debug && log_output_enabled)
OSUtility::WriteOutput(OSUtility::Output_StdOut, msg);
#endif
#if defined(OUTPUT_LOG_TO_STDERR)
// don't output debug messages to stdout/stderr
if(type != RDCLog_Debug)
if(type != RDCLog_Debug && log_output_enabled)
OSUtility::WriteOutput(OSUtility::Output_StdErr, msg);
#endif
#if defined(OUTPUT_LOG_TO_DISK)
+3
View File
@@ -254,10 +254,13 @@ void rdclog_int(LogType type, const char *file, unsigned int line, const char *f
const char *rdclog_getfilename();
void rdclog_filename(const char *filename);
void rdclog_enableoutput();
#define RDCLOGFILE(fn) rdclog_filename(fn)
#define RDCGETLOGFILE() rdclog_getfilename()
#define RDCLOGOUTPUT() rdclog_enableoutput()
#if(!defined(RELEASE) || defined(FORCE_DEBUG_LOGS)) && !defined(STRIP_DEBUG_LOGS)
#define RDCDEBUG(...) rdclog(RDCLog_Debug, __VA_ARGS__)
#else
+4
View File
@@ -322,6 +322,10 @@ void RenderDoc::Initialise()
RecreateCrashHandler();
}
}
// begin printing to stdout/stderr after this point, earlier logging is debugging
// cruft that we don't want cluttering output
RDCLOGOUTPUT();
}
RenderDoc::~RenderDoc()