Here is an updated patch that just introduces LSN_FORMAT_ARGS(). I think the result is quite pleasant.
-- Peter Eisentraut2ndQuadrant, an EDB companyhttps://www.2ndquadrant.com/