00001 /* 00002 * Copyright 2004,2005 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef AXIS2_LOG_H 00018 #define AXIS2_LOG_H 00019 00020 #include <axis2_allocator.h> 00021 00022 #ifdef __cplusplus 00023 extern "C" 00024 { 00025 #endif 00026 00027 struct axis2_log; 00028 struct axis2_log_ops; 00029 00039 typedef enum axis2_log_levels 00040 { 00042 AXIS2_LOG_DEBUG = 0, 00044 AXIS2_LOG_INFO, 00046 AXIS2_LOG_WARNING, 00048 AXIS2_LOG_ERROR, 00050 AXIS2_LOG_CRITICAL 00051 } axis2_log_levels_t; 00052 00058 typedef struct axis2_log_ops 00059 { 00060 00066 axis2_status_t (AXIS2_CALL *free) (struct axis2_log *log); 00067 00074 axis2_status_t (AXIS2_CALL *write) (const void *buffer, size_t count); 00075 } axis2_log_ops_t; 00076 00082 typedef struct axis2_log 00083 { 00085 struct axis2_log_ops *ops; 00087 axis2_log_levels_t level; 00089 axis2_bool_t enabled; 00090 } axis2_log_t; 00091 00092 00093 #define AXIS2_LOG_FREE(log) ((log->ops)->free(log)) 00094 #define AXIS2_LOG_WRITE(log, buffer, count) ((log)->ops->write(buffer, count)) 00095 00098 #ifdef __cplusplus 00099 } 00100 #endif 00101 00102 #endif /* AXIS2_LOG_H */