From: blackh <gra...@li...> - 2003-07-30 10:08:51
|
blackh Wed Jul 30 03:08:51 2003 EDT Modified files: /grapevine start.sh /grapevine/cpp Operation.cpp Operation.h grapevine.cpp Log: Add identifier option to help diagnostics. Index: grapevine/cpp/grapevine.cpp diff -u grapevine/cpp/grapevine.cpp:1.72 grapevine/cpp/grapevine.cpp:1.73 --- grapevine/cpp/grapevine.cpp:1.72 Wed Jul 23 04:50:58 2003 +++ grapevine/cpp/grapevine.cpp Wed Jul 30 03:08:51 2003 @@ -1,5 +1,5 @@ /* - $Id: grapevine.cpp,v 1.72 2003/07/23 11:50:58 blackh Exp $ + $Id: grapevine.cpp,v 1.73 2003/07/30 10:08:51 blackh Exp $ Copyright (c) 2001-2003, Stephen Blackheath, Tony Jones, & Ross Smith. All rights reserved. This is free software; see COPYING for copying conditions. There is NO @@ -114,10 +114,11 @@ << " -r | --rules debug rules" << endl << " -f | --facts debug facts" << endl << " -k | --code debug code" << endl - << " -i | --prefix set tracing prefix fields: 1=date, 2=time, 4=thread (dec)," << endl + << " -e | --prefix set tracing prefix fields: 1=date, 2=time, 4=thread (dec)," << endl << " 8 thread (hex), 16=file/line, 32=function" << endl #endif << " -t | --timestamp add timestamps to log output" << endl + << " -i | --identifier add specified identifier to log output" << endl << " -v | --version display version" << endl << " -? | --help display help" << endl ; @@ -213,9 +214,10 @@ {"code", 0, 0, 'k'}, {"facts", 0, 0, 'f'}, {"rules", 0, 0, 'r'}, - {"prefix", 1, 0, 'i'}, + {"prefix", 1, 0, 'e'}, #endif - {"timestamp", 0, 0, 't'}, + {"timestamp", 0, 0, 't'}, + {"identifier", 1, 0, 'i'}, {NULL, 0, 0, 0} }; @@ -262,6 +264,7 @@ #endif bool profile = false; bool timestamp = false; + const char* identifier = NULL; bool isDaemon = false; try { @@ -294,9 +297,9 @@ "R:" #endif #ifdef _DEBUG - "D:kfri:" + "D:kfre:" #endif - "t" + "ti:" , long_options, &option_index); if (c == -1) break; @@ -348,7 +351,7 @@ case 'D': DBG_SETMASK(p); break; - case 'i': + case 'e': DBG_SETPREFIX(p); break; case 'k': @@ -364,6 +367,9 @@ case 't': timestamp = true; break; + case 'i': + identifier = strdup(p); + break; default: usage(); retval = ERR_SYNTAX_ERROR; @@ -372,6 +378,7 @@ } // end while Print::setTimestamp(timestamp); + Print::setIdentifier(identifier); Print::setDaemon(isDaemon); if (retval) |