You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I'm working in a context in which multiple systems log during the process of running catch. As a result, I tend to see output like the following:
something can be done
Given: A thing with some items
my system logs
system 1 logs
system 2 logs
more system 1 logs
etc.
When: something is done to the thing
even
more
logging
Then: it is done properly
These logs happen sometimes dozens or even hundreds of time between each step of catch, and this occurs for hundreds of tests.
What I would like is the ability to set a prefix of some sort before each line of the catch output so I can get a visual hint in the logging where the catch output is as opposed to other logs, as well as to be able to run a regex to search for or transform it.
As far as I can tell, there is no way to do this properly without modifying the source in every place text is sent to stdout.
Additional context
A good deal of the time, I'm working in Xcode, so trying alternate output forms is not really an option: I'm chained to stdout. And what's more, I want the interleaved logging, as it assists in triage.
My first thought was the obvious one, to strip out the additional logging besides catch, but even with a lot of time spent working through complex regular expressions, it's never quite right: I'm not in control of the other systems that log, nor their style of logging, so capturing the exact form is impossible.
I tried using Catch::cout trickily to insert a prefix before returning std::cout, but that didn't work properly, because catch calls Catch::cout() periodically to call rdbuf() on it, which causes duplicate prefixes.
The text was updated successfully, but these errors were encountered:
Description
I'm working in a context in which multiple systems log during the process of running catch. As a result, I tend to see output like the following:
These logs happen sometimes dozens or even hundreds of time between each step of catch, and this occurs for hundreds of tests.
What I would like is the ability to set a prefix of some sort before each line of the catch output so I can get a visual hint in the logging where the catch output is as opposed to other logs, as well as to be able to run a regex to search for or transform it.
As far as I can tell, there is no way to do this properly without modifying the source in every place text is sent to stdout.
Additional context
Catch::cout
trickily to insert a prefix before returningstd::cout
, but that didn't work properly, because catch callsCatch::cout()
periodically to callrdbuf()
on it, which causes duplicate prefixes.The text was updated successfully, but these errors were encountered: