Re: [gdal-dev] How to supress std io of gdal?
Sam, > 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? It is probably not as sophisticated as you want or need but have you tried that: gdalinfo out.tif > stdout.txt 2> stderr.txt Regards, Ivan > > Thanks > Sam > -- > NEU: Mit GMX DSL über 1000,- ¿ sparen! > http://portal.gmx.net/de/go/dsl02 > ___ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/gdal-dev > ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] How to supress std io of gdal?
I have also reported troubles of this type that unfortunately slipped across the last two gdal releases without being addressed. http://trac.osgeo.org/gdal/ticket/3195 Here the problem is even worst as the errors are print to stdout Joaquim Luis Sam, 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? It is probably not as sophisticated as you want or need but have you tried that: gdalinfo out.tif> stdout.txt 2> stderr.txt Regards, Ivan Thanks Sam -- NEU: Mit GMX DSL über 1000,- ¿ sparen! http://portal.gmx.net/de/go/dsl02 ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] How to supress std io of gdal?
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 ariasg...@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 ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev