Skip to content

Bug in SUNLogger_SetXFilename? #844

@MichaelClerx

Description

@MichaelClerx

Hi all,

In sundials 6 and earlier, I could suppress (expected) warning messages to stdout/stderr (in code, using a precompiled sundials library) with a custom error handler. With the new logging system, it seems like the only way to do this is to pipe warnings to a temporary file?

Loggers created through SUNLogger_Create

SUNErrCode SUNLogger_Create(SUNComm comm, int output_rank, SUNLogger* logger_ptr)

have warnings and errors going to stdout and stderr by default

logger->error_fp = stderr;
logger->warning_fp = stdout;

and calling SUNLogger_SetWarningFilename with NULL or an empty string does not change this:

if (warning_filename && strcmp(warning_filename, ""))

I think this contradicts the manual, which states:

To disable output for one of the streams, then do not set the environment variable, or set it to an empty string.

But this would just cause a call with an empty string, which would just be ignored by SUNLogger_SetWarningFilename etc. again.

Am I missing something, or is this a bug in the SUNLogger_SetXFilename methods?

Best wishes,
Michael

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions