# PetscErrorPrintf
Prints error messages. 
## Synopsis
```
#include <petscsys.h>
PetscErrorCode (*PetscErrorPrintf)(const char format[],...);
```
Not Collective


## Input Parameter

- ***format -*** the usual printf() format string



## Options Database Keys

- ***-error_output_stdout -*** cause error messages to be printed to stdout instead of the (default) stderr
- ***-error_output_none -*** to turn off all printing of error messages (does not change the way the error is handled.)



## Notes
Use
```none
PetscErrorPrintf = PetscErrorPrintfNone; to turn off all printing of error messages (does not change the way the
```
```none
error is handled.) and
```
```none
PetscErrorPrintf = PetscErrorPrintfDefault; to turn it back on or you can use your own function
```

Use
`PETSC_STDERR` = FILE* obtained from a file open etc. to have stderr printed to the file.
`PETSC_STDOUT` = FILE* obtained from a file open etc. to have stdout printed to the file.

Use
`PetscPushErrorHandler()` to provide your own error handler that determines what kind of messages to print




## Fortran Note
This routine is not supported in Fortran.


## See Also
 `PetscFPrintf()`, `PetscSynchronizedPrintf()`, `PetscHelpPrintf()`, `PetscPrintf()`, `PetscPushErrorHandler()`, `PetscVFPrintf()`, `PetscHelpPrintf()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscerror.h.html#PetscErrorPrintf">include/petscerror.h</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex30.c.html">src/snes/tutorials/ex30.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscerror.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
