folly: symbolizer: small terse write fix + colorize signal handler output if printing...
[folly.git] / folly / experimental / exception_tracer / ExceptionTracer.cpp
index c2fd2b9f566d2d6df997c0e4f297324a7014c382..04d3b55ea0efb77b8be75831c1db435068657e34 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2014 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-
 #include "folly/experimental/exception_tracer/ExceptionTracer.h"
 
 #include <dlfcn.h>
@@ -69,7 +68,7 @@ std::ostream& operator<<(std::ostream& out, const ExceptionInfo& info) {
       Symbolizer symbolizer;
       symbolizer.symbolize(addresses, frames.data(), frameCount);
 
-      OStreamSymbolizePrinter osp(out);
+      OStreamSymbolizePrinter osp(out, SymbolizePrinter::COLOR_IF_TTY);
       osp.println(addresses, frames.data(), frameCount);
     }
   } catch (const std::exception& e) {
@@ -206,4 +205,3 @@ void installHandlers() {
 
 }  // namespace exception_tracer
 }  // namespace folly
-