consolidation of log/debug message interface
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5b_attribs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __H5BLOCK_IO_H
|
||||
#define __H5BLOCK_IO_H
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5b_io.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __H5BLOCK_MODEL
|
||||
#define __H5BLOCK_MODEL
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5b_model.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define __H5FED_ADJACENCY_H
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5t_adjacencies.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define __H5FED_MODEL_H
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5t_model.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define __H5FED_RETRIEVE_H
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5_syscall.h"
|
||||
#include "h5core/h5t_map.h"
|
||||
#include "h5core/h5t_retrieve.h"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define __H5FED_STORE_H
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5t_store.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define __H5FED_TAGS_H
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5t_tags.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef H5PART_IO
|
||||
#define H5PART_IO
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5u_io.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef H5PART_MODEL
|
||||
#define H5PART_MODEL
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5u_model.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __H5_ATTACHMENTS_H
|
||||
#define __H5_ATTACHMENTS_H
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5_model.h"
|
||||
#include "h5core/h5_attachments.h"
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
!
|
||||
! Copyright (c) 2006-2016, The Regents of the University of California,
|
||||
! through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
! required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
! Institut (Switzerland). All rights reserved.!
|
||||
!
|
||||
! License: see file COPYING in top level of source distribution.
|
||||
!
|
||||
INTERFACE
|
||||
|
||||
!> \addtogroup h5_debug_fvalue
|
||||
!! @{
|
||||
|
||||
!>
|
||||
!! Set debug mask. The debug mask is an or'ed value of
|
||||
!!
|
||||
!! - \c H5_DEBUG_API: C-API calls
|
||||
!! - \c H5_DEBUG_CORE_API: core API calls. The core API is used by the C- and Fortran API.
|
||||
!! - \c H5_DEBUG_PRIV_API: private API calls
|
||||
!! - \c H5_DEBUG_PRIV_FUNC: static functions
|
||||
!! - \c H5_DEBUG_HDF5: HDF5 wrapper calls
|
||||
!! - \c H5_DEBUG_MPI: MPI wrapper calls
|
||||
!! - \c H5_DEBUG_MALLOC: memory allocation
|
||||
!! - \c H5_DEBUG_ALL: enable all
|
||||
!!
|
||||
!! \return \c H5_SUCCESS
|
||||
!!
|
||||
!! \see h5_get_debug_mask()
|
||||
|
||||
SUBROUTINE h5_set_debug_mask ( mask )
|
||||
INTEGER*8, INTENT(IN) :: mask !< [in] debug mask
|
||||
END SUBROUTINE h5_set_debug_mask
|
||||
|
||||
!>
|
||||
!! Get debug mask.
|
||||
!!
|
||||
!! \return debug mask
|
||||
!!
|
||||
!! \see h5_set_debug_mask()
|
||||
|
||||
INTEGER*8 FUNCTION h5_get_debug_mask ()
|
||||
END FUNCTION h5_get_debug_mask
|
||||
|
||||
!> @}
|
||||
END INTERFACE
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2006-2016, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#ifndef __H5_DEBUG_H
|
||||
#define __H5_DEBUG_H
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
|
||||
/**
|
||||
\addtogroup h5_debug
|
||||
@{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
Set debug mask. The debug mask is an or'ed value of
|
||||
|
||||
- \c H5_DEBUG_API: C-API calls
|
||||
- \c H5_DEBUG_CORE_API: core API calls.
|
||||
- \c H5_DEBUG_PRIV_API: private API calls
|
||||
- \c H5_DEBUG_PRIV_FUNC: static functions
|
||||
- \c H5_DEBUG_HDF5: HDF5 wrapper calls
|
||||
- \c H5_DEBUG_MPI: MPI wrapper calls
|
||||
- \c H5_DEBUG_MALLOC: memory allocation
|
||||
- \c H5_DEBUG_ALL: enable all
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
|
||||
\see H5GetDebugMask()
|
||||
|
||||
\note
|
||||
| Release | Change |
|
||||
| :------ | :----- |
|
||||
| \c 1.99.15 | Function introduced in this release. |
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5SetDebugMask (
|
||||
const h5_id_t mask ///< [in] debug mask
|
||||
) {
|
||||
return h5_set_debuglevel (mask & ~0x03);
|
||||
}
|
||||
|
||||
/**
|
||||
Get debug mask.
|
||||
|
||||
\return debug mask
|
||||
|
||||
\see H5SetDebugMask()
|
||||
|
||||
\note
|
||||
| Release | Change |
|
||||
| :------ | :----- |
|
||||
| \c 1.99.15 | Function introduced in this release. |
|
||||
*/
|
||||
static inline h5_id_t
|
||||
H5GetDebugMask (
|
||||
void
|
||||
) {
|
||||
return (h5_get_debuglevel () & ~0x03);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
///< @}
|
||||
#endif
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __H5_ERROR_H
|
||||
#define __H5_ERROR_H
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
|
||||
/**
|
||||
\addtogroup h5_error
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __H5_FILE_H
|
||||
#define __H5_FILE_H
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5_file.h"
|
||||
|
||||
#include <hdf5.h>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5_file_attribs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -41,4 +41,40 @@
|
||||
END FUNCTION h5_get_verbosity_level
|
||||
|
||||
!> @}
|
||||
|
||||
!> \addtogroup h5_debug_fvalue
|
||||
!! @{
|
||||
|
||||
!>
|
||||
!! Set debug mask. The debug mask is an or'ed value of
|
||||
!!
|
||||
!! - \c H5_DEBUG_API: C-API calls
|
||||
!! - \c H5_DEBUG_CORE_API: core API calls. The core API is used by the C- and Fortran API.
|
||||
!! - \c H5_DEBUG_PRIV_API: private API calls
|
||||
!! - \c H5_DEBUG_PRIV_FUNC: static functions
|
||||
!! - \c H5_DEBUG_HDF5: HDF5 wrapper calls
|
||||
!! - \c H5_DEBUG_MPI: MPI wrapper calls
|
||||
!! - \c H5_DEBUG_MALLOC: memory allocation
|
||||
!! - \c H5_DEBUG_ALL: enable all
|
||||
!!
|
||||
!! \return \c H5_SUCCESS
|
||||
!!
|
||||
!! \see h5_get_debug_mask()
|
||||
|
||||
SUBROUTINE h5_set_debug_mask ( mask )
|
||||
INTEGER*8, INTENT(IN) :: mask !< [in] debug mask
|
||||
END SUBROUTINE h5_set_debug_mask
|
||||
|
||||
!>
|
||||
!! Get debug mask.
|
||||
!!
|
||||
!! \return debug mask
|
||||
!!
|
||||
!! \see h5_set_debug_mask()
|
||||
|
||||
INTEGER*8 FUNCTION h5_get_debug_mask ()
|
||||
END FUNCTION h5_get_debug_mask
|
||||
|
||||
!> @}
|
||||
|
||||
END INTERFACE
|
||||
|
||||
+61
-4
@@ -11,7 +11,7 @@
|
||||
#define __H5_LOG_H
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
|
||||
#if H5HUT_API_VERSION == 2
|
||||
#define H5SetVerbosityLevel2 H5SetVerbosityLevel
|
||||
@@ -52,7 +52,7 @@ static inline h5_err_t
|
||||
H5SetVerbosityLevel2 (
|
||||
const h5_id_t level ///< [in] verbosity level.
|
||||
) {
|
||||
return h5_set_debuglevel (level & 0x03);
|
||||
return h5_set_loglevel (level & 0x03);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ static inline h5_err_t
|
||||
H5SetVerbosityLevel1 (
|
||||
const h5_id_t level ///< [in] verbosity level.
|
||||
) {
|
||||
return h5_set_debuglevel (level);
|
||||
return h5_set_loglevel (level);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,62 @@ static inline h5_id_t
|
||||
H5GetVerbosityLevel (
|
||||
void
|
||||
) {
|
||||
return h5_get_debuglevel () & 0x03;
|
||||
return h5_get_loglevel () & 0x03;
|
||||
}
|
||||
|
||||
///< @}
|
||||
|
||||
|
||||
/**
|
||||
\addtogroup h5_debug
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
Set debug mask. The debug mask is an or'ed value of
|
||||
|
||||
- \c H5_DEBUG_API: C-API calls
|
||||
- \c H5_DEBUG_CORE_API: core API calls.
|
||||
- \c H5_DEBUG_PRIV_API: private API calls
|
||||
- \c H5_DEBUG_PRIV_FUNC: static functions
|
||||
- \c H5_DEBUG_HDF5: HDF5 wrapper calls
|
||||
- \c H5_DEBUG_MPI: MPI wrapper calls
|
||||
- \c H5_DEBUG_MALLOC: memory allocation
|
||||
- \c H5_DEBUG_ALL: enable all
|
||||
|
||||
\return \c H5_SUCCESS
|
||||
|
||||
\see H5GetDebugMask()
|
||||
|
||||
\note
|
||||
| Release | Change |
|
||||
| :------ | :----- |
|
||||
| \c 1.99.15 | Function introduced in this release. |
|
||||
*/
|
||||
static inline h5_err_t
|
||||
H5SetDebugMask (
|
||||
const h5_id_t mask ///< [in] debug mask
|
||||
) {
|
||||
return h5_set_loglevel (mask & ~0x03);
|
||||
}
|
||||
|
||||
/**
|
||||
Get debug mask.
|
||||
|
||||
\return debug mask
|
||||
|
||||
\see H5SetDebugMask()
|
||||
|
||||
\note
|
||||
| Release | Change |
|
||||
| :------ | :----- |
|
||||
| \c 1.99.15 | Function introduced in this release. |
|
||||
*/
|
||||
static inline h5_id_t
|
||||
H5GetDebugMask (
|
||||
void
|
||||
) {
|
||||
return (h5_get_loglevel () & ~0x03);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -96,5 +151,7 @@ H5GetVerbosityLevel (
|
||||
#endif
|
||||
|
||||
///< @}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __H5_MODEL_H
|
||||
#define __H5_MODEL_H
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5_model.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
#include "h5core/h5_step_attribs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -14,7 +14,6 @@ MODULE H5hut
|
||||
include 'H5_file_attribs.f90'
|
||||
include 'H5_step_attribs.f90'
|
||||
include 'H5_log.f90'
|
||||
include 'H5_debug.f90'
|
||||
include 'H5_err.f90'
|
||||
|
||||
include 'H5Part_model.f90'
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "H5_file_attribs.h"
|
||||
#include "H5_step_attribs.h"
|
||||
#include "H5_log.h"
|
||||
#include "H5_debug.h"
|
||||
#include "H5_err.h"
|
||||
|
||||
#include "H5Part_io.h"
|
||||
|
||||
@@ -2,12 +2,12 @@ otherincludedir = $(includedir)/h5core
|
||||
|
||||
include_HEADERS = \
|
||||
h5_attachments.h \
|
||||
h5_debug.h \
|
||||
h5_err.h \
|
||||
h5_file.h \
|
||||
h5_file_attribs.h \
|
||||
h5_step_attribs.h \
|
||||
h5_log.h \
|
||||
h5_model.h \
|
||||
h5_step_attribs.h \
|
||||
h5_syscall.h \
|
||||
h5_types.h \
|
||||
h5b_attribs.h \
|
||||
@@ -20,8 +20,8 @@ include_HEADERS = \
|
||||
h5t_retrieve.h \
|
||||
h5t_store.h \
|
||||
h5t_tags.h \
|
||||
h5u_model.h \
|
||||
h5u_io.h
|
||||
h5u_io.h \
|
||||
h5u_model.h
|
||||
|
||||
clean-local:
|
||||
$(RM) *~
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#ifndef __H5CORE_H5_DEBUG_H
|
||||
#define __H5CORE_H5_DEBUG_H
|
||||
#ifndef __H5CORE_H5_LOG_H
|
||||
#define __H5CORE_H5_LOG_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
@@ -74,7 +74,7 @@ struct call_stack {
|
||||
struct call_stack_entry entry[1024];
|
||||
};
|
||||
|
||||
extern h5_int32_t h5_debug_level;
|
||||
extern h5_int32_t h5_log_level;
|
||||
extern struct call_stack h5_call_stack;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -190,7 +190,7 @@ h5_warn (
|
||||
const char* fmt,
|
||||
...
|
||||
) {
|
||||
if (h5_debug_level >= 2) {
|
||||
if (h5_log_level >= 2) {
|
||||
va_list ap;
|
||||
va_start (ap, fmt);
|
||||
h5priv_vprintf (stderr, "W", h5_get_funcname(), fmt, ap);
|
||||
@@ -218,7 +218,7 @@ h5_info (
|
||||
const char* fmt,
|
||||
...
|
||||
) {
|
||||
if (h5_debug_level >= 3) {
|
||||
if (h5_log_level >= 3) {
|
||||
va_list ap;
|
||||
va_start (ap, fmt);
|
||||
h5priv_vprintf (stdout, "I", h5_get_funcname(), fmt, ap);
|
||||
@@ -246,7 +246,7 @@ h5_debug (
|
||||
const char *fmt,
|
||||
...
|
||||
) {
|
||||
if (h5_debug_level >= 4) {
|
||||
if (h5_log_level >= 4) {
|
||||
char prefix[1024];
|
||||
snprintf (prefix, sizeof(prefix), "%*s %s",
|
||||
h5_call_stack_get_level(), "",
|
||||
@@ -274,13 +274,13 @@ h5_debug (
|
||||
#define __API_ENTER(type, mask, fmt, ...) \
|
||||
h5_call_stack_push (__func__,e_##type); \
|
||||
type ret_value = (type)H5_ERR; \
|
||||
if (h5_debug_level & mask ) { \
|
||||
if (h5_log_level & mask ) { \
|
||||
h5_debug ("(" fmt ")", __VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define __FUNC_ENTER(type, mask, fmt, ...) \
|
||||
type ret_value = (type)H5_ERR; \
|
||||
if (h5_debug_level & mask ) { \
|
||||
if (h5_log_level & mask ) { \
|
||||
h5_call_stack_push (__func__,e_##type); \
|
||||
h5_debug ("(" fmt ")", __VA_ARGS__); \
|
||||
} \
|
||||
@@ -321,7 +321,7 @@ done: \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
done: \
|
||||
if (h5_debug_level & mask ) { \
|
||||
if (h5_log_level & mask ) { \
|
||||
char fmt[256]; \
|
||||
snprintf (fmt, sizeof(fmt), "return: %s", \
|
||||
h5_rfmts[h5_call_stack_get_type()]); \
|
||||
@@ -334,7 +334,7 @@ done: \
|
||||
ret_value = expr; \
|
||||
goto done; \
|
||||
done: \
|
||||
if (h5_debug_level & mask ) { \
|
||||
if (h5_log_level & mask ) { \
|
||||
char fmt[256]; \
|
||||
snprintf (fmt, sizeof(fmt), "return: %s", \
|
||||
h5_rfmts[h5_call_stack_get_type()]); \
|
||||
@@ -359,11 +359,11 @@ done: \
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5_set_debuglevel (
|
||||
h5_set_loglevel (
|
||||
const h5_id_t);
|
||||
|
||||
h5_err_t
|
||||
h5_get_debuglevel (
|
||||
h5_get_loglevel (
|
||||
void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5_debug.h"
|
||||
#include "h5core/h5_log.h"
|
||||
|
||||
#define MALLOC_WRAPPER_ENTER(type, fmt, ...) \
|
||||
__FUNC_ENTER(type, H5_DEBUG_MALLOC, fmt, __VA_ARGS__)
|
||||
|
||||
Reference in New Issue
Block a user