Hey folks,

I'd like to know how I could set a custom error handling function in the GDAL Python bindings?

Currently I was able to turn off error messages like so:

>>> gdal.PushErrorHandler("CPLQuietErrorHandler")

What I want is something like this:

>>> def f(error):
...    logger.error(error)
...
>>> gdal.PushErrorHandler(f)

But I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/osgeo/gdal.py", line 312, in PushErrorHandler
    return _gdal.PushErrorHandler(*args)
NotImplementedError: Wrong number of arguments for overloaded function 'PushErrorHandler'.
  Possible C/C++ prototypes are:
    PushErrorHandler(char const *)
    CPLPushErrorHandler(CPLErrorHandler)

If possible, I'd like a solution that works with 1.8.

Thanks,
Fabian
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to