salesforce / p4-fusion

A fast Perforce to Git conversion tool written in C++ using Perforce Helix Core C++ API and Libgit2
BSD 3-Clause "New" or "Revised" License
78 stars 15 forks source link

Optionally omit colour codes from logs #41

Closed twarit-waikar closed 2 years ago

twarit-waikar commented 2 years ago

While running p4-fusion remotely, it may happen the shell output or the shell output capture doesn't support displaying colour codes properly, and so p4-fusion logs would usually be surrounded with weird unicode embeds as shown below.

\u001b[91m[ ERROR @ Run:113 ] Connection dropped or command errored, retrying in 5 seconds.\u001b[0m

We should provide an optional build flag that omits the colour codes from the logging macros present in common.h https://github.com/salesforce/p4-fusion/blob/6746b6065719517b10739d5eda87a2c906822fcd/p4-fusion/common.h#L18-L29