You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/02/03 12:53:11 UTC

svn commit: r374642 - in /webservices/axis2/trunk/c: include/axis2_log.h modules/util/env.c modules/util/log.c

Author: sahan
Date: Fri Feb  3 03:53:01 2006
New Revision: 374642

URL: http://svn.apache.org/viewcvs?rev=374642&view=rev
Log:
Fixed a bug in log_free

Modified:
    webservices/axis2/trunk/c/include/axis2_log.h
    webservices/axis2/trunk/c/modules/util/env.c
    webservices/axis2/trunk/c/modules/util/log.c

Modified: webservices/axis2/trunk/c/include/axis2_log.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_log.h?rev=374642&r1=374641&r2=374642&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_log.h (original)
+++ webservices/axis2/trunk/c/include/axis2_log.h Fri Feb  3 03:53:01 2006
@@ -24,8 +24,8 @@
 {
 #endif
 
-    struct axis2_log;
-    struct axis2_log_ops;
+    typedef struct axis2_log_ops axis2_log_ops_t;
+	typedef struct axis2_log axis2_log_t;
 
 
 #define AXIS2_LOG_SI __FILE__,__LINE__
@@ -78,7 +78,7 @@
     *
     * Encapsulator struct for ops of axis2_log
     */
-    typedef struct axis2_log_ops
+    struct axis2_log_ops
     {
     
       /**
@@ -86,7 +86,8 @@
        * @return axis2_status_t AXIS2_SUCCESS on success else AXIS2_FAILURE
        */
 
-       axis2_status_t (AXIS2_CALL *free) (struct axis2_log *log);
+       axis2_status_t (AXIS2_CALL *free) (axis2_allocator_t *allocator, 
+						struct axis2_log *log);
 
       /**
         * writes to the log
@@ -94,21 +95,21 @@
         * @param size size of the buffer to be written to log
         * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE
         */
-        axis2_status_t (AXIS2_CALL *write) (struct axis2_log *log, const axis2_char_t *buffer, axis2_log_levels_t level,const axis2_char_t *file,const int line);
+        axis2_status_t (AXIS2_CALL *write) (axis2_log_t *log, const axis2_char_t *buffer, axis2_log_levels_t level,const axis2_char_t *file,const int line);
 
-		axis2_status_t (AXIS2_CALL *log_critical) (struct axis2_log *log,const char *filename,const int linenumber,axis2_char_t *format,...);
-		axis2_status_t (AXIS2_CALL *log_error) (struct axis2_log *log,const char *filename,const int linenumber,axis2_char_t *format,...);
-		axis2_status_t (AXIS2_CALL *log_warning) (struct axis2_log *log,const char *filename,const int linenumber,axis2_char_t *format,...);
-		axis2_status_t (AXIS2_CALL *log_info) (struct axis2_log *log, axis2_char_t *format, ...);
-		axis2_status_t (AXIS2_CALL *log_debug) (struct axis2_log *log,const char *filename,const int linenumber,axis2_char_t *format,...);
-    } axis2_log_ops_t;
+		axis2_status_t (AXIS2_CALL *log_critical) (axis2_log_t *log,const char *filename,const int linenumber,axis2_char_t *format,...);
+		axis2_status_t (AXIS2_CALL *log_error) (axis2_log_t *log,const char *filename,const int linenumber,axis2_char_t *format,...);
+		axis2_status_t (AXIS2_CALL *log_warning) (axis2_log_t *log,const char *filename,const int linenumber,axis2_char_t *format,...);
+		axis2_status_t (AXIS2_CALL *log_info) (axis2_log_t *log, axis2_char_t *format, ...);
+		axis2_status_t (AXIS2_CALL *log_debug) (axis2_log_t *log,const char *filename,const int linenumber,axis2_char_t *format,...);
+    };
 
   /** 
     * \brief Axis2 Log struct
     *
     * Log is the encapsulating struct for all log related data and ops
     */
-    typedef struct axis2_log
+    struct axis2_log
     {
         /** Log related ops */
         struct axis2_log_ops *ops;
@@ -119,7 +120,7 @@
         /** Is logging enabled? */
         axis2_bool_t enabled;
 
-    } axis2_log_t;
+    };
 
 axis2_status_t AXIS2_CALL axis2_log_impl_log_critical(axis2_log_t *log,const axis2_char_t *filename,const int linenumber,const axis2_char_t *format,...);
 
@@ -132,7 +133,7 @@
 axis2_status_t AXIS2_CALL axis2_log_impl_log_debug(axis2_log_t *log,const axis2_char_t *filename,const int linenumber,const axis2_char_t *format,...);
 
 
-#define AXIS2_LOG_FREE(log) ((log->ops)->free(log))
+#define AXIS2_LOG_FREE(allocator, log) ((log->ops)->free(allocator, log))
 
 #define AXIS2_LOG_WRITE(log, buffer, level) ((log)->ops->write(log, buffer, level,AXIS2_LOG_SI))
 

Modified: webservices/axis2/trunk/c/modules/util/env.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/env.c?rev=374642&r1=374641&r2=374642&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/env.c (original)
+++ webservices/axis2/trunk/c/modules/util/env.c Fri Feb  3 03:53:01 2006
@@ -23,7 +23,7 @@
 AXIS2_DECLARE(axis2_status_t)  axis2_env_free (axis2_env_t *env)
 {
     if(NULL != env && NULL != env->log)
-        AXIS2_LOG_FREE(env->log);
+        AXIS2_LOG_FREE(env->allocator, env->log);
 	
 	if(NULL != env && NULL != env->error)
         AXIS2_ERROR_FREE(env->error);

Modified: webservices/axis2/trunk/c/modules/util/log.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/log.c?rev=374642&r1=374641&r2=374642&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/log.c (original)
+++ webservices/axis2/trunk/c/modules/util/log.c Fri Feb  3 03:53:01 2006
@@ -85,7 +85,7 @@
     	log_file_name[len*sizeof(axis2_char_t) - sizeof(axis2_char_t)] = '\0';
 		printf("default file name = %s\n",log_file_name);
 	}
-	log_impl->stream = axis2_file_handler_open(log_file_name,"w");
+	log_impl->stream = axis2_file_handler_open("axis2.log","w");
 	
 	log_impl->log.enabled = 1;
 
@@ -206,7 +206,8 @@
     	va_start(ap, format);
     	AXIS2_VSNPRINTF(value, AXIS2_LEN_VALUE, format, ap);
     	va_end(ap);
-		axis2_log_impl_write_to_file(fd, AXIS2_LOG_LEVEL_DEBUG, filename, linenumber, value);
+		axis2_log_impl_write_to_file(fd, AXIS2_LOG_LEVEL_DEBUG, filename, 
+						linenumber, value);
 	}
 	return 0;
 }
@@ -257,7 +258,8 @@
     	va_start(ap, format);
     	AXIS2_VSNPRINTF(value, AXIS2_LEN_VALUE, format, ap);
     	va_end(ap);
-		axis2_log_impl_write_to_file(fd, AXIS2_LOG_LEVEL_WARNING, filename, linenumber, value);
+		axis2_log_impl_write_to_file(fd, AXIS2_LOG_LEVEL_WARNING, filename, 
+						linenumber, value);
 	}
 	return 0;
 }
@@ -282,7 +284,8 @@
    	va_start(ap, format);
   	AXIS2_VSNPRINTF(value, AXIS2_LEN_VALUE, format, ap);
    	va_end(ap);
-	axis2_log_impl_write_to_file(fd, AXIS2_LOG_LEVEL_ERROR, filename, linenumber, value);
+	axis2_log_impl_write_to_file(fd, AXIS2_LOG_LEVEL_ERROR, filename, 
+						linenumber, value);
 	return 0;
 }
 	
@@ -305,7 +308,7 @@
    	va_start(ap, format);
    	AXIS2_VSNPRINTF(value, AXIS2_LEN_VALUE, format, ap);
    	va_end(ap);
-	axis2_log_impl_write_to_file(fd, AXIS2_LOG_LEVEL_CRITICAL, filename, linenumber, value);
+	axis2_log_impl_write_to_file(fd, AXIS2_LOG_LEVEL_CRITICAL, filename, 
+						linenumber, value);
 	return 0;
-}
-
+}