1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

Simplify debug logging by allowing log functions to return String objects.

Previously, debug log functions had to handle NULLs and truncate output to the available buffer size.  This was verbose for both coding and testing.

Instead, create a function/macro combination that allows log functions to return a simple String object.  The wrapper function takes care of the memory context, handles NULLs, and truncates the log string based on the available buffer size.
This commit is contained in:
David Steele
2018-09-11 18:32:56 -04:00
parent 9b9396c7b7
commit 5aa458ffae
34 changed files with 139 additions and 327 deletions
+2 -2
View File
@@ -137,7 +137,7 @@ P00 DEBUG: info/info::infoNew: (fileName: {"<REPO:ARCHIVE>/archive.info"})
P00 DEBUG: info/info::infoNew: => {Info}
P00 DEBUG: info/info::infoIni: (this: {Info})
P00 DEBUG: info/info::infoIni: => {Ini}
P00 DEBUG: info/infoPg::infoPgAdd: (this: {InfoPg}, infoPgData: {"id: 1, version: 90400, systemId 1000000000000000094, catalog 0, control 0"})
P00 DEBUG: info/infoPg::infoPgAdd: (this: {InfoPg}, infoPgData: {id: 1, version: 90400, systemId: 1000000000000000094, catalogVersion: 0, controlVersion: 0})
P00 DEBUG: info/infoPg::infoPgAdd: => 0
P00 DEBUG: info/infoPg::infoPgNew: => {InfoPg}
P00 DEBUG: info/infoArchive::infoArchiveNew: => {InfoArchive}
@@ -181,7 +181,7 @@ P00 DEBUG: info/info::infoNew: (fileName: {"<REPO:ARCHIVE>/archive.info"})
P00 DEBUG: info/info::infoNew: => {Info}
P00 DEBUG: info/info::infoIni: (this: {Info})
P00 DEBUG: info/info::infoIni: => {Ini}
P00 DEBUG: info/infoPg::infoPgAdd: (this: {InfoPg}, infoPgData: {"id: 1, version: 90400, systemId 1000000000000000094, catalog 0, control 0"})
P00 DEBUG: info/infoPg::infoPgAdd: (this: {InfoPg}, infoPgData: {id: 1, version: 90400, systemId: 1000000000000000094, catalogVersion: 0, controlVersion: 0})
P00 DEBUG: info/infoPg::infoPgAdd: => 0
P00 DEBUG: info/infoPg::infoPgNew: => {InfoPg}
P00 DEBUG: info/infoArchive::infoArchiveNew: => {InfoArchive}
+2 -2
View File
@@ -554,9 +554,9 @@ P00 DEBUG: info/info::infoNew: (fileName: {"<REPO:ARCHIVE>/archive.info"})
P00 DEBUG: info/info::infoNew: => {Info}
P00 DEBUG: info/info::infoIni: (this: {Info})
P00 DEBUG: info/info::infoIni: => {Ini}
P00 DEBUG: info/infoPg::infoPgAdd: (this: {InfoPg}, infoPgData: {"id: 2, version: 90400, systemId 1000000000000000094, catalog 0, control 0"})
P00 DEBUG: info/infoPg::infoPgAdd: (this: {InfoPg}, infoPgData: {id: 2, version: 90400, systemId: 1000000000000000094, catalogVersion: 0, controlVersion: 0})
P00 DEBUG: info/infoPg::infoPgAdd: => 0
P00 DEBUG: info/infoPg::infoPgAdd: (this: {InfoPg}, infoPgData: {"id: 1, version: 90300, systemId 1000000000000000093, catalog 0, control 0"})
P00 DEBUG: info/infoPg::infoPgAdd: (this: {InfoPg}, infoPgData: {id: 1, version: 90300, systemId: 1000000000000000093, catalogVersion: 0, controlVersion: 0})
P00 DEBUG: info/infoPg::infoPgAdd: => 1
P00 DEBUG: info/infoPg::infoPgNew: => {InfoPg}
P00 DEBUG: info/infoArchive::infoArchiveNew: => {InfoArchive}