Commit b738f9a6 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Changed NMXP_LOG_D_PACKET to NMXP_LOG_D_CHANSTATE

Changed prefix in log message to 'nmxp'


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@837 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent db9f536d
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy * Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it * quintiliani@ingv.it
* *
* $Id: nmxp_log.h,v 1.12 2008-02-29 10:09:27 mtheo Exp $ * $Id: nmxp_log.h,v 1.13 2008-03-01 22:32:44 mtheo Exp $
* *
*/ */
...@@ -38,18 +38,18 @@ ...@@ -38,18 +38,18 @@
/*! kind of log message */ /*! kind of log message */
#define NMXP_LOG_D_NULL 0 #define NMXP_LOG_D_NULL 0
#define NMXP_LOG_D_PACKET 1 #define NMXP_LOG_D_CHANSTATE 1
#define NMXP_LOG_D_CHANNEL NMXP_LOG_D_PACKET << 1 #define NMXP_LOG_D_CHANNEL NMXP_LOG_D_CHANSTATE << 1
#define NMXP_LOG_D_RAWSTREAM NMXP_LOG_D_PACKET << 2 #define NMXP_LOG_D_RAWSTREAM NMXP_LOG_D_CHANSTATE << 2
#define NMXP_LOG_D_CRC NMXP_LOG_D_PACKET << 3 #define NMXP_LOG_D_CRC NMXP_LOG_D_CHANSTATE << 3
#define NMXP_LOG_D_CONNFLOW NMXP_LOG_D_PACKET << 4 #define NMXP_LOG_D_CONNFLOW NMXP_LOG_D_CHANSTATE << 4
#define NMXP_LOG_D_PACKETMAN NMXP_LOG_D_PACKET << 5 #define NMXP_LOG_D_PACKETMAN NMXP_LOG_D_CHANSTATE << 5
#define NMXP_LOG_D_EXTRA NMXP_LOG_D_PACKET << 6 #define NMXP_LOG_D_EXTRA NMXP_LOG_D_CHANSTATE << 6
#define NMXP_LOG_D_DATE NMXP_LOG_D_PACKET << 7 #define NMXP_LOG_D_DATE NMXP_LOG_D_CHANSTATE << 7
#define NMXP_LOG_D_GAP NMXP_LOG_D_PACKET << 8 #define NMXP_LOG_D_GAP NMXP_LOG_D_CHANSTATE << 8
#define NMXP_LOG_D_DOD NMXP_LOG_D_PACKET << 9 #define NMXP_LOG_D_DOD NMXP_LOG_D_CHANSTATE << 9
#define NMXP_LOG_D_ANY \ #define NMXP_LOG_D_ANY \
( NMXP_LOG_D_PACKET | NMXP_LOG_D_CHANNEL | NMXP_LOG_D_RAWSTREAM | NMXP_LOG_D_CRC | NMXP_LOG_D_CONNFLOW | \ ( NMXP_LOG_D_CHANSTATE | NMXP_LOG_D_CHANNEL | NMXP_LOG_D_RAWSTREAM | NMXP_LOG_D_CRC | NMXP_LOG_D_CONNFLOW | \
NMXP_LOG_D_PACKETMAN | NMXP_LOG_D_EXTRA | NMXP_LOG_D_DATE | NMXP_LOG_D_GAP | NMXP_LOG_D_DOD ) NMXP_LOG_D_PACKETMAN | NMXP_LOG_D_EXTRA | NMXP_LOG_D_DATE | NMXP_LOG_D_GAP | NMXP_LOG_D_DOD )
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy * Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it * quintiliani@ingv.it
* *
* $Id: nmxp_log.c,v 1.15 2008-02-24 15:10:52 mtheo Exp $ * $Id: nmxp_log.c,v 1.16 2008-03-01 22:32:44 mtheo Exp $
* *
*/ */
...@@ -83,6 +83,9 @@ void nmxp_log_print_all(char *message, int (*a_func_log[NMXP_MAX_FUNC_LOG]) (cha ...@@ -83,6 +83,9 @@ void nmxp_log_print_all(char *message, int (*a_func_log[NMXP_MAX_FUNC_LOG]) (cha
} }
} }
/* #define NMXP_LOG_PREFIX PACKAGE_NAME */
#define NMXP_LOG_PREFIX "nmxp"
int nmxp_log(int level, int verb, ... ) int nmxp_log(int level, int verb, ... )
{ {
static int staticverb = 0; static int staticverb = 0;
...@@ -112,11 +115,11 @@ int nmxp_log(int level, int verb, ... ) ...@@ -112,11 +115,11 @@ int nmxp_log(int level, int verb, ... )
switch(level) { switch(level) {
case NMXP_LOG_ERR: case NMXP_LOG_ERR:
sprintf(message_final, "%s - %s: error: %s", timestr, PACKAGE_NAME, message); sprintf(message_final, "%s - %s error: %s", timestr, NMXP_LOG_PREFIX, message);
nmxp_log_print_all(message_final, p_func_log_err, n_func_log_err); nmxp_log_print_all(message_final, p_func_log_err, n_func_log_err);
break; break;
case NMXP_LOG_WARN: case NMXP_LOG_WARN:
sprintf(message_final, "%s - %s: warning: %s", timestr, PACKAGE_NAME, message); sprintf(message_final, "%s - %s warning: %s", timestr, NMXP_LOG_PREFIX, message);
nmxp_log_print_all(message_final, p_func_log, n_func_log); nmxp_log_print_all(message_final, p_func_log, n_func_log);
break; break;
case NMXP_LOG_NORM_NO: case NMXP_LOG_NORM_NO:
...@@ -124,11 +127,11 @@ int nmxp_log(int level, int verb, ... ) ...@@ -124,11 +127,11 @@ int nmxp_log(int level, int verb, ... )
nmxp_log_print_all(message_final, p_func_log, n_func_log); nmxp_log_print_all(message_final, p_func_log, n_func_log);
break; break;
case NMXP_LOG_NORM_PKG: case NMXP_LOG_NORM_PKG:
sprintf(message_final, "%s: %s", PACKAGE_NAME, message); sprintf(message_final, "%s: %s", NMXP_LOG_PREFIX, message);
nmxp_log_print_all(message_final, p_func_log, n_func_log); nmxp_log_print_all(message_final, p_func_log, n_func_log);
break; break;
default: default:
sprintf(message_final, "%s - %s: %s", timestr, PACKAGE_NAME, message); sprintf(message_final, "%s - %s: %s", timestr, NMXP_LOG_PREFIX, message);
nmxp_log_print_all(message_final, p_func_log, n_func_log); nmxp_log_print_all(message_final, p_func_log, n_func_log);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment