[gdal-dev] How to supress std io of gdal?

Ari Jolma ari.jolma at gmail.com
Fri Feb 12 09:27:43 EST 2010


Sam,

There is CPLSetErrorHandler, which you can use to set your own error 
handler function:

http://www.gdal.org/ogr/cpl__error_8h.html#74d0e649d58180e621540bf73b58e4a2

This is used for example by the HL bindings to redirect warnings and 
errors to respective systems of the HLs. See:

http://trac.osgeo.org/gdal/browser/trunk/gdal/swig/include/cpl_exceptions.i

Regards,

Ari

ariasgore at gmx.de wrote:
> Hello,
> I've been looking into the docs and also into the source without much luck.
> When it comes to error handling, functions like GDALOpen just dump everything to the console when reading file error or similar things occur.
>
> Is this customizable? GDAL is deeply burried in the logic-code part of our code which is not supposed to break the architecture by dumping unwanted information to the console or whatever is tied to the output stream.
> Is there a way to redirect it to some other buffer? Like an internal stream which can then be properly propagated via exceptions or written into a log?
>
> Thanks
> Sam
>   



More information about the gdal-dev mailing list