ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r588142 - in /webservices/axis2/branches/c/29092007: src/core/transport/http/server/simple_axis2_server/http_server_main.c util/include/axutil_log.h util/src/log.c
Date Thu, 25 Oct 2007 05:11:42 GMT
Author: damitha
Date: Wed Oct 24 22:11:40 2007
New Revision: 588142

URL: http://svn.apache.org/viewvc?rev=588142&view=rev
Log:
Enabling service level log messages

Modified:
    webservices/axis2/branches/c/29092007/src/core/transport/http/server/simple_axis2_server/http_server_main.c
    webservices/axis2/branches/c/29092007/util/include/axutil_log.h
    webservices/axis2/branches/c/29092007/util/src/log.c

Modified: webservices/axis2/branches/c/29092007/src/core/transport/http/server/simple_axis2_server/http_server_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/29092007/src/core/transport/http/server/simple_axis2_server/http_server_main.c?rev=588142&r1=588141&r2=588142&view=diff
==============================================================================
--- webservices/axis2/branches/c/29092007/src/core/transport/http/server/simple_axis2_server/http_server_main.c
(original)
+++ webservices/axis2/branches/c/29092007/src/core/transport/http/server/simple_axis2_server/http_server_main.c
Wed Oct 24 22:11:40 2007
@@ -127,7 +127,7 @@
             log_level = AXIS2_ATOI(optarg);
             if (log_level < AXIS2_LOG_LEVEL_CRITICAL)
                 log_level = AXIS2_LOG_LEVEL_CRITICAL;
-            if (log_level > AXIS2_LOG_LEVEL_TRACE)
+            if (log_level > AXIS2_LOG_LEVEL_SERVICE)
                 log_level = AXIS2_LOG_LEVEL_TRACE;
             break;
         case 'f':
@@ -214,7 +214,7 @@
     fprintf(stdout,
             "\t-l LOG_LEVEL\t log level, available log levels:"
             "\n\t\t\t 0 - critical    1 - errors 2 - warnings"
-            "\n\t\t\t 3 - information 4 - debug  5- trace"
+            "\n\t\t\t 3 - information 4 - debug  5- trace 6- service"
             "\n\t\t\t Default log level is 4(debug).\n");
     fprintf(stdout,
             "\t-f LOG_FILE\t log file, default is $AXIS2C_HOME/logs/axis2.log"

Modified: webservices/axis2/branches/c/29092007/util/include/axutil_log.h
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/29092007/util/include/axutil_log.h?rev=588142&r1=588141&r2=588142&view=diff
==============================================================================
--- webservices/axis2/branches/c/29092007/util/include/axutil_log.h (original)
+++ webservices/axis2/branches/c/29092007/util/include/axutil_log.h Wed Oct 24 22:11:40 2007
@@ -45,6 +45,7 @@
       *"log this test 123" into the log file
       *
       *similar macros are defined for different log levels: CRITICAL,ERROR,WARNING and INFO
+      * and SERVICE
       *
       *CRITICAL and ERROR logs are always written to file and other logs are written 
       *depending on the log level set (log->level)
@@ -72,7 +73,10 @@
         AXIS2_LOG_LEVEL_DEBUG,
 
         /** Trace level, Enable with compiler time option AXIS2_TRACE */
-        AXIS2_LOG_LEVEL_TRACE
+        AXIS2_LOG_LEVEL_TRACE,
+        
+        /** Service level, logs only service level debug messages */
+        AXIS2_LOG_LEVEL_SERVICE
     } axutil_log_levels_t;
 
     /**
@@ -160,6 +164,14 @@
         ...);
 
     AXIS2_EXTERN void AXIS2_CALL
+    axutil_log_impl_log_service(
+        axutil_log_t * log,
+        const axis2_char_t * filename,
+        const int linenumber,
+        const axis2_char_t * format,
+        ...);
+
+    AXIS2_EXTERN void AXIS2_CALL
     axutil_log_impl_log_debug(
         axutil_log_t * log,
         const axis2_char_t * filename,
@@ -195,6 +207,7 @@
 #define AXIS2_LOG_WRITE(log, buffer, level, file) \
       axutil_log_write(log, buffer, level, file, AXIS2_LOG_SI)
 
+#define AXIS2_LOG_SERVICE axutil_log_impl_log_service
 #define AXIS2_LOG_DEBUG axutil_log_impl_log_debug
 #define AXIS2_LOG_INFO axutil_log_impl_log_info
 #define AXIS2_LOG_WARNING axutil_log_impl_log_warning

Modified: webservices/axis2/branches/c/29092007/util/src/log.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/29092007/util/src/log.c?rev=588142&r1=588141&r2=588142&view=diff
==============================================================================
--- webservices/axis2/branches/c/29092007/util/src/log.c (original)
+++ webservices/axis2/branches/c/29092007/util/src/log.c Wed Oct 24 22:11:40 2007
@@ -231,6 +231,8 @@
             case AXIS2_LOG_LEVEL_TRACE:
                 level_str = "[...TRACE...] ";
                 break;
+            case AXIS2_LOG_LEVEL_SERVICE:
+                break;
             }
             fprintf(stderr, "%s %s(%d) %s\n", level_str, file, line, buffer);
         }
@@ -276,6 +278,8 @@
     case AXIS2_LOG_LEVEL_TRACE:
         level_str = "[...TRACE...] ";
         break;
+    case AXIS2_LOG_LEVEL_SERVICE:
+        break;
     }
     axutil_thread_mutex_lock(mutex);
 
@@ -332,6 +336,45 @@
 }
 
 AXIS2_EXTERN void AXIS2_CALL
+axutil_log_impl_log_service(
+    axutil_log_t * log,
+    const axis2_char_t * filename,
+    const int linenumber,
+    const axis2_char_t * format,
+    ...)
+{
+    FILE *fd = NULL;
+    axutil_thread_mutex_t *mutex = NULL;
+
+    if (log && format)
+    {
+
+        if (!(fd = AXIS2_INTF_TO_IMPL(log)->stream))
+        {
+            fprintf(stderr, "Stream is not found\n");
+        }
+
+        if (!(mutex = AXIS2_INTF_TO_IMPL(log)->mutex))
+        {
+            fprintf(stderr, "Log mutex is not found\n");
+
+        }
+        if (AXIS2_LOG_LEVEL_DEBUG <= log->level)
+        {
+            char value[AXIS2_LEN_VALUE + 1];
+            va_list ap;
+            va_start(ap, format);
+            AXIS2_VSNPRINTF(value, AXIS2_LEN_VALUE, format, ap);
+            va_end(ap);
+            axutil_log_impl_write_to_file(log, mutex, AXIS2_LOG_LEVEL_DEBUG,
+                filename, linenumber, value);
+        }
+    }
+    else
+        fprintf(stderr, "please check your log and buffer");
+}
+
+AXIS2_EXTERN void AXIS2_CALL
 axutil_log_impl_log_debug(
     axutil_log_t * log,
     const axis2_char_t * filename,
@@ -356,7 +399,8 @@
 
         }
 
-        if (AXIS2_LOG_LEVEL_DEBUG <= log->level)
+        if (AXIS2_LOG_LEVEL_DEBUG <= log->level && 
+            log->level != AXIS2_LOG_LEVEL_SERVICE)
         {
             char value[AXIS2_LEN_VALUE + 1];
             va_list ap;
@@ -394,7 +438,8 @@
 
         }
 
-        if (AXIS2_LOG_LEVEL_INFO <= log->level)
+        if (AXIS2_LOG_LEVEL_INFO <= log->level &&
+            log->level != AXIS2_LOG_LEVEL_SERVICE)
         {
             char value[AXIS2_LEN_VALUE + 1];
             va_list ap;
@@ -435,7 +480,8 @@
 
         }
 
-        if (AXIS2_LOG_LEVEL_WARNING <= log->level)
+        if (AXIS2_LOG_LEVEL_WARNING <= log->level &&
+            log->level != AXIS2_LOG_LEVEL_SERVICE)
         {
             char value[AXIS2_LEN_VALUE + 1];
             va_list ap;
@@ -612,7 +658,8 @@
 
         }
 
-        if (AXIS2_LOG_LEVEL_TRACE <= log->level)
+        if (AXIS2_LOG_LEVEL_TRACE <= log->level &&
+            log->level != AXIS2_LOG_LEVEL_SERVICE)
         {
             char value[AXIS2_LEN_VALUE + 1];
             va_list ap;



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message