#ifdef _WIN32
color = COLOR_OPTION_ALWAYS;
#else
- color = isatty(1) ? COLOR_OPTION_ALWAYS : COLOR_OPTION_NEVER;
+ color = isatty(STDERR_FILENO) ? COLOR_OPTION_ALWAYS : COLOR_OPTION_NEVER;
pipepager();
#endif
}
#include <iostream>
#include "os_time.hpp"
-#include "trace_dump.hpp"
#include "retrace.hpp"
namespace retrace {
+trace::DumpFlags dumpFlags = 0;
+
+
static bool call_dumped = false;
static void dumpCall(trace::Call &call) {
if (verbosity >= 0 && !call_dumped) {
std::cout << std::hex << call.thread_id << std::dec << " ";
- std::cout << call;
+ trace::dump(call, std::cout, dumpFlags);
std::cout.flush();
call_dumped = true;
}
#include "trace_model.hpp"
#include "trace_parser.hpp"
#include "trace_profiler.hpp"
+#include "trace_dump.hpp"
#include "scoped_allocator.hpp"
extern unsigned frameNo;
extern unsigned callNo;
+extern trace::DumpFlags dumpFlags;
std::ostream &warning(trace::Call &call);
#include <limits.h> // for CHAR_MAX
#include <iostream>
#include <getopt.h>
+#ifndef _WIN32
+#include <unistd.h> // for isatty()
+#endif
#include "os_binary.hpp"
#include "os_time.hpp"
}
}
+#ifndef _WIN32
+ if (!isatty(STDOUT_FILENO)) {
+ dumpFlags |= trace::DUMP_FLAG_NO_COLOR;
+ }
+#endif
+
retrace::setUp();
if (retrace::profiling) {
retrace::profiler.setup(retrace::profilingCpuTimes, retrace::profilingGpuTimes, retrace::profilingPixelsDrawn, retrace::profilingMemoryUsage);