title: ColoredPrintf in recent googletest
body: <p>I was using rather obsolete version of GoogleTest and have used hack for custom printing, found here: <a href="https://stackoverflow.com/questions/16491675/how-to-send-custom-message-in-google-c-testing-framework/29155677">How to send custom message in Google C++ Testing Framework?</a></p>
  <p>My sources contain the following code from the link above</p>
  <pre><code>namespace testing
  {
   namespace internal
   {
    enum GTestColor {
        COLOR_DEFAULT,
        COLOR_RED,
        COLOR_GREEN,
        COLOR_YELLOW
    };
  
    extern void ColoredPrintf(GTestColor color, const char* fmt, ...);
   }
  }
  #define PRINTF(...)  do { testing::internal::ColoredPrintf(testing::internal::COLOR_GREEN, &quot;[          ] &quot;); testing::internal::ColoredPrintf(testing::internal::COLOR_YELLOW, __VA_ARGS__); } while(0)
  
  </code></pre>
  <p>I have updated sources of GoogleTest in my project to master version and now I have link errors saying that ColoredPrintf is not defined.</p>
  <pre><code>error LNK2019: unresolved external symbol &quot;void __cdecl testing::internal::ColoredPrintf(enum testing::internal::`anonymous namespace'::GTestColor,char const *,...)&quot; (?ColoredPrintf@internal@testing@@YAXW4GTestColor@?A0x313d419f@12@PEBDZZ) referenced in function
  </code></pre>
  <p>Studying fresh <code>gtest.cc</code> shows that they have changed <code>GTestColor</code> to enum class and put it into an anonymous namespace inside the namespace <code>testing::internal</code>:
  <a href="https://github.com/google/googletest/blob/master/googletest/src/gtest.cc#L3138" rel="nofollow noreferrer">https://github.com/google/googletest/blob/master/googletest/src/gtest.cc#L3138</a></p>
  <p>I've changed the snippet in my sources to:</p>
  <pre><code>namespace testing {
      namespace internal
      {
          enum class GTestColor { kDefault, kRed, kGreen, kYellow };
  
          extern void ColoredPrintf(GTestColor color, const char* fmt, ...);
      }
  }
  </code></pre>
  <p>And as a quick fix I have removed <code>namespace { ... }</code> around <code>GTestColor</code> in <code>gtest.cc</code>.</p>
  <p>The question: is it possible to avoid editing <code>gtest.cc</code> and still have access to their function?</p>