ndt-dev - [ndt-dev] [ndt] r746 committed - Cleanup: changing log levels , removing unwanted prints, function hea...
Subject: NDT-DEV email list created
List archive
[ndt-dev] [ndt] r746 committed - Cleanup: changing log levels , removing unwanted prints, function hea...
Chronological Thread
- From:
- To:
- Subject: [ndt-dev] [ndt] r746 committed - Cleanup: changing log levels , removing unwanted prints, function hea...
- Date: Sun, 30 Oct 2011 16:18:10 +0000
Revision: 746
Author:
Date: Sun Oct 30 09:17:00 2011
Log: Cleanup: changing log levels , removing unwanted prints, function header template
http://code.google.com/p/ndt/source/detail?r=746
Modified:
/branches/kkumar_code_organize/src/logging.c
/branches/kkumar_code_organize/src/testoptions.c
/branches/kkumar_code_organize/src/usage.c
/branches/kkumar_code_organize/src/utils.c
/branches/kkumar_code_organize/src/web100clt.c
=======================================
--- /branches/kkumar_code_organize/src/logging.c Fri Oct 28 07:58:55
2011
+++ /branches/kkumar_code_organize/src/logging.c Sun Oct 30 09:17:00
2011
@@ -410,6 +410,7 @@
* in a list of key-value pairs
* @param key string key
* @param value string value associated with this key
+ * @param socketnum Socket fd
*/
void protolog_printgeneric(const char* key, const char* value, int socketnum) {
FILE * fp;
@@ -428,16 +429,12 @@
fp = fopen(get_protologfile(socketnum), "a");
if (fp == NULL) {
- printf(
- "--Unable to open proto file while trying to record key-vale: %s:%s \n",
- key, value);
log_println(5,
"--Unable to open proto file while trying to
record msg: %s \n",
key, value);
} else {
fprintf(fp, " event=\"%s\", name=\"%s\", time=\"%s\"\n", key,
value,
get_ISOtime(isotime, sizeof(isotime)));
- printf("%s = \"%s\" \n", key, logmessage);
fclose(fp);
}
}
@@ -449,6 +446,7 @@
* @param testid enumerator indicating name of the test @see TEST_ID
* @param pid PID of process
* @param teststatus enumerator indicating test status. @see TEST_STATUS_INT
+ * @param socketnum Socket fd
*
*/
void protolog_status(int pid, enum TEST_ID testid,
@@ -473,9 +471,6 @@
fp = fopen(get_protologfile(socketnum), "a");
if (fp == NULL) {
- printf(
- "--Unable to open protocol log file while trying to record test status message: %s for the %s test \n",
- teststatusdesc, currenttestname);
log_println(
5,
"--Unable to open protocol log file while trying to record test status message: %s for the %s test \n",
@@ -485,8 +480,6 @@
" event=\"%s\", name=\"%s\", pid=\"%d\",
time=\"%s\"\n",
teststatusdesc, currenttestname, pid,
get_ISOtime(isotime, sizeof(isotime)));
- printf("%s: <-- %d - %s - %s --> \n ", protomessage, pid,
- teststatusdesc, currenttestname);
fprintf(fp, "%s", protomessage);
fclose(fp);
}
@@ -500,7 +493,7 @@
* @param testidarg enumerator indicating name of the test @see TEST_ID
* @param procidarg enumerator indicating name of the test @see PROCESS_TYPE_INT
* @param teststatusarg enumerator indicating test status. @see TEST_STATUS_INT
- *
+ * @param socketnum Socket fd
*/
void protolog_procstatus(int pid, enum TEST_ID testidarg,
enum PROCESS_TYPE_INT procidarg, enum PROCESS_STATUS_INT teststatusarg, int socketnum) {
@@ -536,14 +529,12 @@
"--Unable to open protocol log file while trying to record process status message: %s for the %s test \n",
procstatusdesc, currentprocname);
} else {
- log_println(0, " a0\n %s, %s, %s,%d", procstatusdesc,currentprocname,currenttestname,pid);
+ log_println(8, " a0\n %s, %s, %s,%d", procstatusdesc,currentprocname,currenttestname,pid);
sprintf(
protomessage,
" event=\"%s\", name=\"%s\", test=\"%s\", pid=\"%d\",
time=\"%s\"\n",
procstatusdesc, currentprocname,
currenttestname, pid,
get_ISOtime(isotime, sizeof(isotime)));
- printf("%s: -- %d - %s - %s - %s -- \n ", protomessage, pid,
- currenttestname, procstatusdesc,
currentprocname);
fprintf(fp, "%s", protomessage);
fclose(fp);
}
@@ -596,10 +587,6 @@
" event=\"message\", direction=\"%s\", test=\"%s\", type=\"%s\", len=\"%d\", msg=\"%s\", pid=\"%d\", socket=\"%d\", time=\"%s\"\n",
msgdirection, currenttestname,
currentmsgtype, len, logmessage,
processid, ctlSocket, get_ISOtime(isotime,
sizeof(isotime)));
- printf(
- "direction = %s, test= %s, type=%s, len=%d, msg=%s, pid=%d, socket=%d, time=%s\n",
- msgdirection, currenttestname,
currentmsgtype, len, logmessage,
- processid, ctlSocket, get_ISOtime(isotime,
sizeof(isotime)));
fclose(fp);
}
}
@@ -619,7 +606,7 @@
char *currentDir;
if (!enableprotologging) {
- log_println(0, "Protocol logging is not enabled");
+ log_println(3, "Protocol logging is not enabled");
return;
}
currentDir = get_currentdirndesc();
@@ -645,7 +632,6 @@
return;
}
otherDir = get_otherdirndesc();
- //protolog_println(lvl, otherDir, type, msg, len, processid,
ctlSocket);
protolog_println(otherDir, type, msg, len, processid, ctlSocket);
}
=======================================
--- /branches/kkumar_code_organize/src/testoptions.c Fri Oct 21 14:32:05 2011
+++ /branches/kkumar_code_organize/src/testoptions.c Sun Oct 30 09:17:00 2011
@@ -186,8 +186,8 @@
int msgType;
int msgLen = 1;
int first = 1;
- char remhostarr[256], protologlocalarr[256];
- char *remhost_ptr = get_remotehost();
+ //char remhostarr[256], protologlocalarr[256];
+ //char *remhost_ptr = get_remotehost();
assert(ctlsockfd != -1);
assert(options);
@@ -214,7 +214,7 @@
"Client connect received from :IP %s to some server on
socket %d",
get_remotehost(), ctlsockfd);
- set_protologfile(get_remotehost(), protologlocalarr);
+ //set_protologfile(get_remotehost(), protologlocalarr);
if (!(useropt
& (TEST_MID | TEST_C2S | TEST_S2C | TEST_SFW |
TEST_STATUS
=======================================
--- /branches/kkumar_code_organize/src/usage.c Fri Oct 28 08:06:41 2011
+++ /branches/kkumar_code_organize/src/usage.c Sun Oct 30 09:17:00 2011
@@ -1,4 +1,4 @@
-/*
+/**
* This file contains the functions to print usage screens.
*
* Jakub S³awiñski 2006-06-02
@@ -13,7 +13,7 @@
#include <assert.h>
/**
- * Prints the short usage of the application.
+ * Print the short usage of the application.
* @param prog The name of the application
* @param info Text printed in the first line
*/
@@ -27,10 +27,9 @@
exit(1);
}
-/*
- * Function name: srv_long_usage
- * Description: Prints the long usage of the web100srv.
- * Arguments: info - the text printed in the first line
+/**
+ * Print the long usage of the web100srv.
+ * @param info text printed in the first line
*/
void srv_long_usage(char* info) {
@@ -120,10 +119,9 @@
exit(0);
}
-/*
- * Function name: clt_long_usage
- * Description: Prints the long usage of the web100clt.
- * Arguments: info - the text printed in the first line
+/**
+ * Print the long usage of the web100clt.
+ * @param info text printed in the first line
*/
void clt_long_usage(char* info) {
@@ -157,10 +155,9 @@
exit(0);
}
-/*
- * Function name: www_long_usage
- * Description: Prints the long usage of the fakewww.
- * Arguments: info - the text printed in the first line
+/**
+ * Print the long usage of the fakewww.
+ * @param info text printed in the first line
*/
void www_long_usage(char* info) {
@@ -200,10 +197,9 @@
exit(0);
}
-/*
- * Function name: analyze_long_usage
- * Description: Prints the long usage of the analyze.
- * Arguments: info - the text printed in the first line
+/**
+ * Print the long usage of the analyze.
+ * @param info text printed in the first line
*/
void analyze_long_usage(char* info) {
@@ -221,10 +217,9 @@
exit(0);
}
-/*
- * Function name: mkmap_long_usage
- * Description: Prints the long usage of the tr-mkmap.
- * Arguments: info - the text printed in the first line
+/**
+ * Print the long usage of the tr-mkmap.
+ * @arg info text printed in the first line
*/
void mkmap_long_usage(char* info) {
@@ -258,10 +253,9 @@
exit(0);
}
-/*
- * Function name: vt_long_usage
- * Description: Prints the long usage of the viewtrace.
- * Arguments: info - the text printed in the first line
+/**
+ * Print long usage of the viewtrace.
+ * @param info text printed in the first line
*/
void vt_long_usage(char* info) {
@@ -287,10 +281,10 @@
exit(0);
}
-/*
- * Function name: genplot_long_usage
- * Description: Prints the long usage of the genplot.
- * Arguments: info - the text printed in the first line
+/**
+ * Print the long usage of the genplot.
+ * @param info text printed in the first line
+ * @param argv0 Process name
*/
void genplot_long_usage(char* info, char* argv0) {
=======================================
--- /branches/kkumar_code_organize/src/utils.c Fri Oct 28 19:23:28 2011
+++ /branches/kkumar_code_organize/src/utils.c Sun Oct 30 09:17:00 2011
@@ -192,7 +192,7 @@
}
}
output_buf[j] = '\0'; // null terminate
- printf("****Received=%s; len=%d; dest=%d; MSG=%s", line, line_size,
+ log_println(8,"Received=%s; len=%d; dest=%d; MSG=%s\n", line,
line_size,
strlen(output_buf), output_buf);
return j - 1;
}
=======================================
--- /branches/kkumar_code_organize/src/web100clt.c Fri Oct 28 07:58:55
2011
+++ /branches/kkumar_code_organize/src/web100clt.c Sun Oct 30 09:17:00
2011
@@ -115,7 +115,7 @@
* values of settings that have been detected.
*
* @param tests test indicator character
- * @param tmpstr Result string obtained at the end of tests from the server
+ * @param testresult_str Result string obtained at the end of tests from the server
* @param host server host name string
*/
void testResults(char tests, char *testresult_str, char* host) {
@@ -523,11 +523,9 @@
host = optarg;
break;
case 'u':
- printf("Calling set protolog from case-u");
set_protologdir(optarg);
break;
case 'e':
- printf("Enabling protocol logging");
enableprotocollogging();
break;
case 301:
- [ndt-dev] [ndt] r746 committed - Cleanup: changing log levels , removing unwanted prints, function hea..., ndt, 10/30/2011
Archive powered by MHonArc 2.6.16.