Author: samisa
Date: Thu Jan 19 03:08:01 2006
New Revision: 370459
URL: http://svn.apache.org/viewcvs?rev=370459&view=rev
Log:
Fixed the logging level related problems
Modified:
webservices/axis2/trunk/c/include/axis2_env.h
webservices/axis2/trunk/c/include/axis2_log.h
webservices/axis2/trunk/c/include/axis2_stream.h
webservices/axis2/trunk/c/modules/core/engine/addr_disp.c
webservices/axis2/trunk/c/modules/core/engine/disp_checker.c
webservices/axis2/trunk/c/modules/core/engine/engine.c
webservices/axis2/trunk/c/modules/core/engine/phase.c
webservices/axis2/trunk/c/modules/core/engine/req_uri_disp.c
webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c
webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c
webservices/axis2/trunk/c/modules/util/env.c
webservices/axis2/trunk/c/modules/util/log.c
Modified: webservices/axis2/trunk/c/include/axis2_env.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_env.h?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_env.h (original)
+++ webservices/axis2/trunk/c/include/axis2_env.h Thu Jan 19 03:08:01 2006
@@ -126,8 +126,8 @@
/**
* Writes given message to the log
*/
- AXIS2_DECLARE(axis2_status_t) axis2_env_write_log (axis2_env_t **env, const char* message);
- #define AXIS2_LOG(env, message) axis2_env_write_log (env,message)
+ AXIS2_DECLARE(axis2_status_t) axis2_env_write_log (axis2_env_t **env, const char* message,
axis2_log_levels_t level);
+ #define AXIS2_LOG(env, message, level) axis2_env_write_log (env,message, level)
#define AXIS2_ENV_CHECK(env, error_return) \
if(!env || !(*env)) \
Modified: webservices/axis2/trunk/c/include/axis2_log.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_log.h?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_log.h (original)
+++ webservices/axis2/trunk/c/include/axis2_log.h Thu Jan 19 03:08:01 2006
@@ -38,16 +38,16 @@
*/
typedef enum axis2_log_levels
{
- /** Debug level, logs everything */
- AXIS2_LOG_DEBUG = 0,
- /** Info level, logs information */
- AXIS2_LOG_INFO,
- /** Warning level, logs only warnings */
- AXIS2_LOG_WARNING,
+ /** Critical level, logs only critical errors */
+ AXIS2_LOG_CRITICAL = 0,
/** Error level, logs only errors */
AXIS2_LOG_ERROR,
- /** Critical level, logs only critical errors */
- AXIS2_LOG_CRITICAL
+ /** Warning level, logs only warnings */
+ AXIS2_LOG_WARNING,
+ /** Info level, logs information */
+ AXIS2_LOG_INFO,
+ /** Debug level, logs everything */
+ AXIS2_LOG_DEBUG
} axis2_log_levels_t;
/**
@@ -71,7 +71,7 @@
* @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) (const axis2_char_t *buffer, axis2_log_levels_t
level);
+ axis2_status_t (AXIS2_CALL *write) (struct axis2_log *log, const axis2_char_t *buffer,
axis2_log_levels_t level);
} axis2_log_ops_t;
/**
@@ -91,7 +91,7 @@
#define AXIS2_LOG_FREE(log) ((log->ops)->free(log))
-#define AXIS2_LOG_WRITE(log, buffer, level) ((log)->ops->write(buffer, level))
+#define AXIS2_LOG_WRITE(log, buffer, level) ((log)->ops->write(log, buffer, level))
/** @} */
Modified: webservices/axis2/trunk/c/include/axis2_stream.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_stream.h?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_stream.h (original)
+++ webservices/axis2/trunk/c/include/axis2_stream.h Thu Jan 19 03:08:01 2006
@@ -42,7 +42,7 @@
* \brief Axis2 stream types
*
* This is used to create a stream to correspond to
-* perticular i/o mtd
+* particular i/o mtd
*/
enum axis2_stream_type
{
Modified: webservices/axis2/trunk/c/modules/core/engine/addr_disp.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/addr_disp.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/addr_disp.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/addr_disp.c Thu Jan 19 03:08:01 2006
@@ -99,8 +99,9 @@
{
axis2_char_t **url_tokens = NULL;
- AXIS2_LOG(env, "Checking for Operation using WSAAction : ");
- AXIS2_LOG(env, address);
+ AXIS2_LOG(env, "Checking for Operation using WSAAction : ", AXIS2_LOG_INFO);
+ AXIS2_LOG(env, address, AXIS2_LOG_INFO);
+ AXIS2_LOG(env, "\n", AXIS2_LOG_INFO);
if ( (AXIS2_STRCMP(AXIS2_WSA_ANONYMOUS_URL, address) == 0 ) ||
(AXIS2_STRCMP(AXIS2_WSA_NAMESPACE_SUBMISSION, address) == 0 ))
@@ -160,8 +161,9 @@
if (action)
{
- AXIS2_LOG(env, "Checking for Operation using WSAAction : ");
- AXIS2_LOG(env, action );
+ AXIS2_LOG(env, "Checking for Operation using WSAAction : ", AXIS2_LOG_INFO);
+ AXIS2_LOG(env, action, AXIS2_LOG_INFO);
+ AXIS2_LOG(env, "\n", AXIS2_LOG_INFO);
qname = axis2_qname_create(env, action, NULL, NULL);
return AXIS2_SVC_GET_OP_WITH_QNAME(svc, env, qname);
Modified: webservices/axis2/trunk/c/modules/core/engine/disp_checker.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/disp_checker.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/disp_checker.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/disp_checker.c Thu Jan 19 03:08:01 2006
@@ -238,11 +238,15 @@
svc = AXIS2_MSG_CTX_GET_SVC(msg_ctx, env);
if (!svc)
{
- AXIS2_LOG(env, "Service Not found. Endpoint reference is ");
+ AXIS2_LOG(env, "Service Not found. Endpoint reference is ", AXIS2_LOG_INFO);
if (endpoint_ref)
{
- AXIS2_LOG(env, AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env));
+ AXIS2_LOG(env, AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env), AXIS2_LOG_INFO);
}
+ else
+ AXIS2_LOG(env, "NULL ", AXIS2_LOG_INFO);
+
+ AXIS2_LOG(env, "\n", AXIS2_LOG_INFO);
return AXIS2_FAILURE;
}
@@ -250,15 +254,21 @@
op = AXIS2_MSG_CTX_GET_OP(msg_ctx, env);
if (!op)
{
- AXIS2_LOG(env, "Operation Not found. Endpoint reference is ");
+ AXIS2_LOG(env, "Operation Not found. Endpoint reference is ", AXIS2_LOG_INFO);
if (endpoint_ref)
{
- AXIS2_LOG(env, AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env));
+ AXIS2_LOG(env, AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env), AXIS2_LOG_INFO);
}
- AXIS2_LOG(env, " and WSA Action = ");
- AXIS2_LOG(env, AXIS2_MSG_CTX_GET_WSA_ACTION(msg_ctx, env));
+ else
+ AXIS2_LOG(env, "NULL ", AXIS2_LOG_INFO);
+
+ AXIS2_LOG(env, "\n", AXIS2_LOG_INFO);
+ AXIS2_LOG(env, " and WSA Action = ", AXIS2_LOG_INFO);
+ AXIS2_LOG(env, AXIS2_MSG_CTX_GET_WSA_ACTION(msg_ctx, env), AXIS2_LOG_INFO);
+ AXIS2_LOG(env, "\n", AXIS2_LOG_INFO);
return AXIS2_FAILURE;
}
return AXIS2_SUCCESS;
}
+
Modified: webservices/axis2/trunk/c/modules/core/engine/engine.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/engine.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/engine.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/engine.c Thu Jan 19 03:08:01 2006
@@ -100,7 +100,7 @@
engine_impl->engine.ops->get_receiver_fault_code = axis2_engine_get_receiver_fault_code;
engine_impl->engine.ops->free = axis2_engine_free;
- AXIS2_LOG(env, "Axis2 Engine Started");
+ AXIS2_LOG(env, "Axis2 Engine Started\n", AXIS2_LOG_INFO);
return &(engine_impl->engine);
}
Modified: webservices/axis2/trunk/c/modules/core/engine/phase.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/phase.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/phase.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/phase.c Thu Jan 19 03:08:01 2006
@@ -163,12 +163,12 @@
phase_impl = AXIS2_INTF_TO_IMPL(phase);
- sprintf(message, "axis2_handler_t *%s added to the index %d of the phase %s",
+ sprintf(message, "axis2_handler_t *%s added to the index %d of the phase %s\n",
AXIS2_QNAME_GET_LOCALPART(AXIS2_HANDLER_GET_NAME(handler, env), env),
index,
phase_impl->name);
- AXIS2_LOG(env, message);
+ AXIS2_LOG(env, message, AXIS2_LOG_INFO);
return AXIS2_ARRAY_LIST_ADD_AT(phase_impl->handlers, env, index, handler);
}
@@ -184,11 +184,11 @@
phase_impl = AXIS2_INTF_TO_IMPL(phase);
- sprintf(message, "Handler %s added to phase %s",
+ sprintf(message, "Handler %s added to phase %s\n",
AXIS2_QNAME_GET_LOCALPART(AXIS2_HANDLER_GET_NAME(handler, env), env),
phase_impl->name);
- AXIS2_LOG(env, message);
+ AXIS2_LOG(env, message, AXIS2_LOG_INFO);
return AXIS2_ARRAY_LIST_ADD(phase_impl->handlers, env, handler);
}
@@ -217,10 +217,10 @@
}
else
{
- sprintf(message, "Invoke the first handler %s within the phase %s",
+ sprintf(message, "Invoke the first handler %s within the phase %s\n",
AXIS2_QNAME_GET_LOCALPART(AXIS2_HANDLER_GET_NAME(phase_impl->first_handler,
env), env),
phase_impl->name);
- AXIS2_LOG(env, message);
+ AXIS2_LOG(env, message, AXIS2_LOG_INFO);
status = AXIS2_HANDLER_INVOKE(phase_impl->first_handler, env, msg_ctx);
if (status != AXIS2_SUCCESS)
return status;
@@ -240,10 +240,10 @@
axis2_handler_t *handler = (axis2_handler_t*) AXIS2_ARRAY_LIST_GET(phase_impl->handlers,
env, index);
if (handler)
{
- sprintf(message, "Invoke the handler %s within the phase %s",
+ sprintf(message, "Invoke the handler %s within the phase %s\n",
AXIS2_QNAME_GET_LOCALPART(AXIS2_HANDLER_GET_NAME(handler, env),
env),
phase_impl->name);
- AXIS2_LOG(env, message);
+ AXIS2_LOG(env, message, AXIS2_LOG_INFO);
status = AXIS2_HANDLER_INVOKE(handler, env, msg_ctx);
if (status != AXIS2_SUCCESS)
return status;
@@ -263,10 +263,10 @@
}
else
{
- sprintf(message, "Invoke the last handler %s within the phase %s",
+ sprintf(message, "Invoke the last handler %s within the phase %s\n",
AXIS2_QNAME_GET_LOCALPART(AXIS2_HANDLER_GET_NAME(phase_impl->last_handler,
env), env),
phase_impl->name);
- AXIS2_LOG(env, message);
+ AXIS2_LOG(env, message, AXIS2_LOG_INFO);
status = AXIS2_HANDLER_INVOKE(phase_impl->last_handler, env, msg_ctx);
if (status != AXIS2_SUCCESS)
return status;
Modified: webservices/axis2/trunk/c/modules/core/engine/req_uri_disp.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/req_uri_disp.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/req_uri_disp.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/req_uri_disp.c Thu Jan 19 03:08:01 2006
@@ -99,8 +99,9 @@
{
axis2_char_t **url_tokens = NULL;
- AXIS2_LOG(env, "Checking for Service using target endpoint address :");
- AXIS2_LOG(env, address);
+ AXIS2_LOG(env, "Checking for Service using target endpoint address :", AXIS2_LOG_INFO);
+ AXIS2_LOG(env, address, AXIS2_LOG_INFO);
+ AXIS2_LOG(env, "\n", AXIS2_LOG_INFO);
url_tokens = axis2_parse_request_url_for_svc_and_op(env, address);
@@ -165,8 +166,9 @@
{
axis2_qname_t *op_qname = NULL;
axis2_op_t *op = NULL;
- AXIS2_LOG(env, "Checking for Operation using target endpoint uri fragment
: ");
- AXIS2_LOG(env, url_tokens[1]);
+ AXIS2_LOG(env, "Checking for Operation using target endpoint uri fragment
: ", AXIS2_LOG_INFO);
+ AXIS2_LOG(env, url_tokens[1], AXIS2_LOG_INFO);
+ AXIS2_LOG(env, "\n", AXIS2_LOG_INFO);
op_qname = axis2_qname_create(env, url_tokens[1], NULL, NULL);
op = AXIS2_SVC_GET_OP_WITH_QNAME(svc, env, op_qname);
AXIS2_QNAME_FREE(op_qname, env);
Modified: webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/soap_action_disp.c Thu Jan 19 03:08:01 2006
@@ -86,7 +86,7 @@
{
AXIS2_FUNC_PARAM_CHECK(msg_ctx, env, NULL);
- AXIS2_LOG(env, "Checking for Service using SOAPAction is a TODO item");
+ AXIS2_LOG(env, "Checking for Service using SOAPAction is a TODO item\n", AXIS2_LOG_INFO);
return NULL;
}
Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/http_server_main.c Thu Jan
19 03:08:01 2006
@@ -72,6 +72,7 @@
}
env = init_syetem_env(allocator);
+ env->log->level = AXIS2_LOG_DEBUG;
axis2_error_init();
Modified: webservices/axis2/trunk/c/modules/util/env.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/env.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/env.c (original)
+++ webservices/axis2/trunk/c/modules/util/env.c Thu Jan 19 03:08:01 2006
@@ -115,7 +115,7 @@
return AXIS2_SUCCESS;
}
-AXIS2_DECLARE(axis2_status_t) axis2_env_write_log (axis2_env_t **env, const char* message)
+AXIS2_DECLARE(axis2_status_t) axis2_env_write_log (axis2_env_t **env, const char* message,
axis2_log_levels_t level)
{
AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
@@ -124,7 +124,7 @@
if (message && (*env)->log)
{
- AXIS2_LOG_WRITE((*env)->log, message, strlen(message) );
+ AXIS2_LOG_WRITE((*env)->log, message, level);
}
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/util/log.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/log.c?rev=370459&r1=370458&r2=370459&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/log.c (original)
+++ webservices/axis2/trunk/c/modules/util/log.c Thu Jan 19 03:08:01 2006
@@ -31,7 +31,7 @@
return 0;
}
-axis2_status_t AXIS2_CALL axis2_log_impl_write (const axis2_char_t *buffer, axis2_log_levels_t
level);
+axis2_status_t AXIS2_CALL axis2_log_impl_write (struct axis2_log *log, const axis2_char_t
*buffer, axis2_log_levels_t level);
AXIS2_DECLARE(axis2_log_t *)
axis2_log_create (axis2_allocator_t * allocator, axis2_log_ops_t * ops)
@@ -66,12 +66,12 @@
}
axis2_status_t AXIS2_CALL
-axis2_log_impl_write (const axis2_char_t *buffer, axis2_log_levels_t level)
+axis2_log_impl_write (struct axis2_log *log, const axis2_char_t *buffer, axis2_log_levels_t
level)
{
- if (!buffer)
+ if (!log || !buffer)
return -1;
-
- fprintf (stderr, "%s", buffer);
+ if (level <= log->level)
+ fprintf (stderr, "%s", buffer);
return 0;
}
|