mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user