summaryrefslogtreecommitdiff
path: root/src/tests/xb_test_log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/xb_test_log.cpp')
-rwxr-xr-xsrc/tests/xb_test_log.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/tests/xb_test_log.cpp b/src/tests/xb_test_log.cpp
index 613b7dd..28ae552 100755
--- a/src/tests/xb_test_log.cpp
+++ b/src/tests/xb_test_log.cpp
@@ -2,7 +2,7 @@
XBase64 Software Library
-Copyright (c) 1997,2003,2014,2022 Gary A Kunkel
+Copyright (c) 1997,2003,2014,2022,2023 Gary A Kunkel
The xb64 software library is covered under the terms of the GPL Version 3, 2007 license.
@@ -21,18 +21,13 @@ Email Contact:
#include "xbase.h"
using namespace xb;
-
#include "tstfuncs.cpp"
-
-
int main( int argCnt, char **av )
{
int rc = 0;
-#ifdef XB_LOGGING_SUPPORT
-
-
+ #ifdef XB_LOGGING_SUPPORT
int po = 1; /* print option */
/* 0 - QUIET */
/* 1 - NORMAL */
@@ -46,6 +41,7 @@ int main( int argCnt, char **av )
}
xbXBase x;
+ x.SetLogDirectory( PROJECT_LOG_DIR );
x.EnableMsgLogging();
InitTime();
if( po ){
@@ -55,21 +51,18 @@ int main( int argCnt, char **av )
sMsg.Sprintf( "Program [%s] initializing...", av[0] );
x.WriteLogMessage( sMsg );
-
xbString sNewLogFileName = "Logfile2.txt";
sMsg.Sprintf( "Switching to logfile [%s]", sNewLogFileName.Str() );
x.WriteLogMessage( sMsg );
-
x.DisableMsgLogging();
rc += TestMethod( po, "Set/Get Log Status()", x.GetLogStatus(), xbFalse );
x.SetLogFileName( sNewLogFileName );
- x.EnableMsgLogging();
+ x.EnableMsgLogging();
rc += TestMethod( po, "Set/Get Log Status()", x.GetLogStatus(), 1 );
rc += TestMethod( po,"WriteLogMessage()", x.WriteLogMessage( "Test log message........" ), XB_NO_ERROR );
-
sMsg.Sprintf( "Program [%s] terminating with [%d] errors...", av[0], rc * -1 );
x.WriteLogMessage( sMsg );