Last modified: 7 December 2015
Name: H5Pset_mdc_log_options
Signature:
  `herr_t H5Pset_mdc_log_options( hid_t fapl_id, hbool_t is_enabled, char *location, hbool_t start_on_access )`
Purpose:
  Sets metadata cache logging options.
Description:
  The metadata cache is a central part of the HDF5 library through which all file metadata reads and writes take place. File metadata is normally invisible to the user and is used by the library for purposes such as locating and indexing data. File metadata should not be confused with user metadata, which consists of attributes created by users and attached to HDF5 objects such as datasets via H5A API calls.

  Due to the complexity of the cache, a trace/logging feature has been created that can be used by HDF5 developers for debugging and performance analysis. The functions that control this functionality will normally be of use to a very limited number of developers outside of The HDF Group. The functions have been documented to help users create logs that can be sent with bug reports.

  Control of the log functionality is straightforward. Logging is enabled via the `H5Pset_mdc_log_options()` function, which will modify the file access property list used to open or create a file. This function has a flag that determines whether logging begins at file open or starts in a paused state. Log messages can then be controlled via the `H5Fstart/stop_logging()` functions. `H5Pget_mdc_log_options()` can be used to examine a file access property list, and `H5Fget_mdc_logging_status()` will return the current state of the logging flags.

  The log format is described in the Metadata Cache Logging document.

Notes:
  Logging is disabled by default.

  When enabled and currently logging, the overhead of the logging feature will almost certainly be significant.

  The log file is currently manipulated using the C standard library’s buffered I/O calls (for example, fprintf) regardless of the virtual file driver (VFD) used. Log events are flushed immediately after the write call.

  On Windows, the location parameter must be an ASCII string since the Windows standard C library’s I/O functions cannot handle UTF-8 file names.

  The log file will be created when the HDF5 file is opened or created regardless of the value of the `start_on_access` parameter. The log file will stay open as long as the HDF5 file is open.

Parameters:

  `hid_t fapl_id` | IN: File access property list identifier.
  `hbool_t is_enabled` | IN: Whether logging is enabled.
  `char *location` | IN: Location of log in UTF-8/ASCII (file path/name) (On Windows, this must be ASCII).
  `hbool_t start_on_access` | IN: Whether the logging will begin as soon as the file is opened or created.

Returns:
  Returns a non-negative value if successful. Otherwise returns a negative value.
Fortran Interface:
  None
See Also:

- H5Pget_mdc_log_options
- H5Fstart_mdc_logging
- H5Fstop_mdc_logging
- H5Pget_mdc_logging_status

History:

  Release | Change
  1.10.0 | C function introduced with this release.