Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWISH: Make it possible to stack stderr (aka "message") sinks #55
Comments
|
Asked about this in R-devel thread 'sink(con, type = "message"): what is the reason why 'message' sinks cannot be stacked?', 2018-03-20 (https://stat.ethz.ch/pipermail/r-devel/2018-March/075734.html) |
…ink/capture stderr for future.clustermq
Issue
In
?sinkwe can read:This prevents us from doing things such as:
The latter two lines are outputted to the message output, which reopened, because the inner capture resets it to the default when it closes it's redirect.
This is a problem, because it prevents all of us from capturing/sinking standard error output ("messages"). If we attempt to do it, we must be careful to make sure there is not already an active "message" sink, otherwise we will destroy the active one. This makes it very complicated to capture stderr in package code. This is basically also what
?sinktells us:Actions
Try to find out why the current limitation exists. Is it deliberate - an active design decision - and if so, then exactly why? Or is it just because no one got around to implement a stacked version for the "message" streams?