Forwarding Ensembles log with CDESetLogCallback

55 views Asked by At

I’m trying to forward Ensembles logging to my logger class. But I'm getting EXC_BAD_ACCESS on first call to CDELog

code for setting CDESetLogCallback :

    lazy var opaquePointerLogFunc : COpaquePointer = {
                let mutablePointer = UnsafeMutablePointer<(String,CVarArgType...) -> Void>.alloc(1)
                mutablePointer.initialize(myLog)
                let opaquePointer = COpaquePointer(mutablePointer)
                return opaquePointer
            }()


    func myLog(message:String, args : CVarArgType ...){
            println(__FUNCTION__)
            //never gets called
        }

    CDESetLogCallback(self.opaquePointerLogFunc)
0

There are 0 answers