RE: libpq debug log
tsunakawa.takay@fujitsu.com <tsunakawa.takay@fujitsu.com>
From: "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
To: "iwata.aya@fujitsu.com" <iwata.aya@fujitsu.com>
Cc: 'Kyotaro Horiguchi' <horikyota.ntt@gmail.com>, "k.jamison@fujitsu.com" <k.jamison@fujitsu.com>, "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-02-12T04:52:52Z
Lists: pgsql-hackers
(48)
<synopsis>
void PQtrace(PGconn *conn, FILE *stream);
</synopsis>
</para>
+ <para>
+ Calls <function>PQtraceSetFlags</function> to output with or without a timestamp.
+ </para>
+
<note>
Why is this necessary? Even if you decide to remove this change, can you share your idea on why you added this just in case?
(49)
+ Determine to output tracing with or without a timestamp to a debugging file stream.
The description should be the overall functionality of this function considering the future additions of flags. Something like:
Controls the tracing behavior of client/server communication.
+ then timestamp is not printed with each message. The default is output with timestamp.
The default value for flags argument (0) should be described here.
Also, it should be added that PQsetTraceFlags() can be called before or after the PQtrace() call.
(50)
I'd like you to consider skipLogging again, because it seems that such a variable is for the logging machinery to control state transitions internally in fe-logging.c.
What I'm concerned is that those who modify libpq have to be aware of skipLogging and would fail to handle it.
(51)
>> +typedef enum PGLogState
>> +{
>>
>> This is libpq-logging.c internal type. It is not needed to be exposed.
> I fixed it.
How did you fix it? The typedef is still in .h file. It should be in .h, shouldn't it? Houw about the other typedefs?
I won't comment on the other stuff on function naming.
Regards
Takayuki Tsunakawa
Commits
-
Rename PQtraceSetFlags() to PQsetTraceFlags().
- d0e750c0acaf 14.0 landed
-
Suppress length of Notice/Error msgs in PQtrace regress mode
- e7e341409a3d 14.0 landed
-
Strip file names reported in error messages on Windows, too.
- 53aafdb9ff6a 14.0 landed
-
Fix setvbuf()-induced crash in libpq_pipeline
- a68a894f0198 14.0 landed
-
libpq_pipeline: Must strdup(optarg) to avoid crash
- dde1a35aee62 14.0 landed
-
Remove setvbuf() call from PQtrace()
- 6ec578e60101 14.0 landed
-
Initialize conn->Pfdebug to NULL when creating a connection
- aba24b51cc1b 14.0 landed
-
Disable force_parallel_mode in libpq_pipeline
- a6d3dea8e5e0 14.0 landed
-
libpq_pipeline: add PQtrace() support and tests
- 7bebd0d00998 14.0 landed
-
Improve PQtrace() output format
- 198b3716dba6 14.0 landed
-
Re-simplify management of inStart in pqParseInput3's subroutines.
- d3a557894ce0 11.12 landed
- d2be6cdc55ad 10.17 landed
- a98e53e10dd5 9.6.22 landed
- 56defbdd0f4e 12.7 landed
- 51c54bb60309 14.0 landed
- 3580b4a0cde0 13.3 landed