NEP 4.3.0
NetCDF Expansion Pack
Loading...
Searching...
No Matches
nep_logging.h File Reference

Internal NEP diagnostic-logging macros. More...

#include <stdlib.h>
#include <assert.h>

Go to the source code of this file.

Macros

#define NEP_TURN_OFF_LOGGING   -1
#define NEP_DEFAULT_LOG_LEVEL   -1
#define ELOG(e)
#define EBAILLOG(e)
#define EBAIL_QUIET   EBAIL
#define EBAIL(e)

Detailed Description

Internal NEP diagnostic-logging macros.

This header is intended for use inside the NEP libraries and UDF handlers. It mirrors the NetCDF-C LOG(()) macro convention used in netcdf-c/libsrc4 and netcdf-c/libhdf5, but uses distinct E-prefixed macro names and routes output through NEP's own nep_log(). This makes NEP logging independent of whether the underlying NetCDF-C build has logging enabled.

The public API for controlling logging is nep_set_log_level(), declared in nep.h.

Author
Edward Hartnett
Date
2026-08-31

Macro Definition Documentation

◆ EBAIL

#define EBAIL ( e)
Value:
do { \
EBAILLOG(e); \
retval = e; \
goto exit; \
} while (0)

Log an error message (if logging is enabled), set retval to e, and jump to the exit: cleanup label.

◆ EBAIL_QUIET

#define EBAIL_QUIET   EBAIL

When logging is disabled, EBAIL_QUIET is equivalent to EBAIL because no message is emitted either way.

◆ EBAILLOG

#define EBAILLOG ( e)
Value:
do { \
} while (0)

No-op when logging is disabled.

◆ ELOG

#define ELOG ( e)

Suppress diagnostic messages when logging is disabled.

◆ NEP_DEFAULT_LOG_LEVEL

#define NEP_DEFAULT_LOG_LEVEL   -1

Default logging level for NEP builds with logging enabled.

◆ NEP_TURN_OFF_LOGGING

#define NEP_TURN_OFF_LOGGING   -1

Value passed to nep_set_log_level() to disable logging.