GnuCash
5.6-150-g038405b370+
|
The transaction logging mechanism provides a very simple, low-level logging of user input to a file. More...
Files | |
file | TransLog.h |
API for the transaction logger. | |
Functions | |
void | xaccOpenLog (void) |
void | xaccCloseLog (void) |
void | xaccReopenLog (void) |
void | xaccTransWriteLog (Transaction *trans, char flag) |
void | xaccLogEnable (void) |
document me | |
void | xaccLogDisable (void) |
document me | |
void | xaccLogSetBaseName (const char *) |
The xaccLogSetBaseName() method sets the base filepath and the root part of the journal file name. More... | |
gboolean | xaccFileIsCurrentLog (const gchar *name) |
Test a filename to see if it is the name of the current logfile. | |
The transaction logging mechanism provides a very simple, low-level logging of user input to a file.
The goal of the transaction logger is to provide mechanism of last resort for recovering lost user data in the event of a crash.
Ideally, the storage backends should provide a robust journaling, logging and crash-recovery mechanism. But just in case they don't, or it didn't work, this mechanism provides a "Plan B" by providing a low-tech, fool-proof, simple logging system that can be used to recover user input. There are some simple command-line tools that will read a log and replay it.
void xaccLogSetBaseName | ( | const char * | ) |
The xaccLogSetBaseName() method sets the base filepath and the root part of the journal file name.
If the journal file is already open, it will close it and reopen it with the new base name.
Definition at line 119 of file TransLog.cpp.
void xaccTransWriteLog | ( | Transaction * | trans, |
char | flag | ||
) |
trans | The transaction to write out to the log |
flag | The engine currently uses the log mechanism with flag char set as follows: 'B' for 'begin edit' (followed by the transaction as it looks before any changes, i.e. the 'old value') 'D' for delete (i.e. delete the previous B; echoes the data in the 'old B') 'C' for commit (i.e. accept a previous B; data that follows is the 'new value') 'R' for rollback (i.e. revert to previous B; data that follows should be identical to old B) |
Definition at line 223 of file TransLog.cpp.