mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
fixed logging
This commit is contained in:
parent
d26df3fb27
commit
e0f92efaa2
@ -48,7 +48,7 @@ extern float nc4_chunk_cache_preemption;
|
||||
/* This is the severity level of messages which will be logged. Use
|
||||
severity 0 for errors, 1 for important log messages, 2 for less
|
||||
important, etc. */
|
||||
int nc_log_level = NC_TURN_OFF_LOGGING;
|
||||
extern int nc_log_level;
|
||||
|
||||
#endif /* LOGGING */
|
||||
|
||||
|
@ -1596,23 +1596,23 @@ nc_set_log_level(int new_level)
|
||||
if(!nc4_hdf5_initialized)
|
||||
nc4_hdf5_initialize();
|
||||
|
||||
/* If the user wants to completely turn off logging, turn off HDF5
|
||||
logging too. Now I truly can't think of what to do if this
|
||||
fails, so just ignore the return code. */
|
||||
if (new_level == NC_TURN_OFF_LOGGING)
|
||||
{
|
||||
set_auto(NULL,NULL);
|
||||
LOG((1, "HDF5 error messages turned off!"));
|
||||
}
|
||||
/* /\* If the user wants to completely turn off logging, turn off HDF5 */
|
||||
/* logging too. Now I truly can't think of what to do if this */
|
||||
/* fails, so just ignore the return code. *\/ */
|
||||
/* if (new_level == NC_TURN_OFF_LOGGING) */
|
||||
/* { */
|
||||
/* set_auto(NULL,NULL); */
|
||||
/* LOG((1, "HDF5 error messages turned off!")); */
|
||||
/* } */
|
||||
|
||||
/* Do we need to turn HDF5 logging back on? */
|
||||
if (new_level > NC_TURN_OFF_LOGGING &&
|
||||
nc_log_level <= NC_TURN_OFF_LOGGING)
|
||||
{
|
||||
if (set_auto((H5E_auto_t)&H5Eprint, stderr) < 0)
|
||||
LOG((0, "H5Eset_auto failed!"));
|
||||
LOG((1, "HDF5 error messages turned on."));
|
||||
}
|
||||
/* /\* Do we need to turn HDF5 logging back on? *\/ */
|
||||
/* if (new_level > NC_TURN_OFF_LOGGING && */
|
||||
/* nc_log_level <= NC_TURN_OFF_LOGGING) */
|
||||
/* { */
|
||||
/* if (set_auto((H5E_auto_t)&H5Eprint, stderr) < 0) */
|
||||
/* LOG((0, "H5Eset_auto failed!")); */
|
||||
/* LOG((1, "HDF5 error messages turned on.")); */
|
||||
/* } */
|
||||
|
||||
/* Now remember the new level. */
|
||||
nc_log_level = new_level;
|
||||
|
Loading…
Reference in New Issue
Block a user