"tsunakawa.ta...@fujitsu.com" <tsunakawa.ta...@fujitsu.com> writes: > Oops, the logging facility needs the destination (conn->pfdebug). So, it > will be:
> void pqLogMessage(PGconn *conn, bool toServer); Right, and it'd need the debug flags too, so +1 for just passing the PGconn instead of handing those over piecemeal. But I think passing the message start address explicitly might be better than having it understand the buffering behavior in enough detail to know where to find the message. Part of the point here (IMO) is to decouple the tracing logic from the core libpq logic, in hopes of not having common-mode bugs. regards, tom lane