(func)
return callback
Error or notice handler callback producr

    Wraps a logger method, func, as a GEOS callback.
Error or notice handler callback producr
Error or notice handler callback producr
def make_logging_callback(func):
    """Error or notice handler callback producr

    Wraps a logger method, func, as a GEOS callback.
    """
    def callback(fmt, *fmt_args):
        fmt = fmt.decode('ascii')
        conversions = re.findall(r'%.', fmt)
        args = [
            string_at(arg).decode('ascii')
            for spec, arg in zip(conversions, fmt_args)
            if spec == '%s' and arg is not None]

        func(fmt, *args)

    return callback
def make_logging_callback ( func ) : def callback ( fmt , * fmt_args ) : fmt = fmt . decode ( 'ascii' ) conversions = re . findall ( r'%.' , fmt ) args = [ string_at ( arg ) . decode ( 'ascii' ) for spec , arg in zip ( conversions , fmt_args ) if spec == '%s' and arg is not None ] func ( fmt , * args ) return callback