diff options
Diffstat (limited to 'docs/html/xbc13.htm')
-rwxr-xr-x | docs/html/xbc13.htm | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/html/xbc13.htm b/docs/html/xbc13.htm new file mode 100755 index 0000000..9f51a85 --- /dev/null +++ b/docs/html/xbc13.htm @@ -0,0 +1,46 @@ + +<!DOCTYPE HTML PUBLIC> +<HTML> +<TITLE>Xbase DBMS Chapter 13</TITLE> +<BODY BGCOLOR=#FFFFFF> +<H2><p align="center">Logfiles</p></H2> +<p align="center">Chapter Updated 11/29/22</p><hr> + + +<h3>Logging</h3> + +The Xbase library includes a logging module that can be turned on or off for auditing purposes. + +See example code below for how to use the logging routines. + +<hr> + +#include "xbase.h"<br> +using namespace xb;<br> +<br> +int main( int argCnt, char **av ){<br> + + #ifdef XB_LOGGING_SUPPORT<br> + xbString sMsg;<br> + xbString sLogFileName;<br> + xbXBase x;<br> + sLogFileName = "/home/xbase/logfiles/LogFile.txt";<br> + x.SetLogFileName( sLogFileName );<br> + x.EnableMsgLogging(); <br><br> + + + std::cout << "Logfile is [" << x.GetLogFqFileName().Str() << "]" << std::endl;<br> + sMsg.Sprintf( "Program [%s] initializing...", av[0] );<br> + x.WriteLogMessage( sMsg );<br> + std::cout << "Logging status is " << x.GetLogStatus() << std::endl;<br> + sMsg = "A logfile message";<br> + x.WriteLogMessage( sMsg );<br> + x.DisableMsgLogging();<br> + #endif /* XB_LOGGING_SUPPORT */<br> + return 0;<br> +}<br> + +<hr> +<p><img src="xbase.jpg"><hr> +</BODY> +</HTML> |