Search code examples
iosswiftsqlite.swiftxcglogger

SQLite.swift: Use XCGLogger


I'm using SQLite.swift library in my iOS project.

Now I'm logging SQLite sentences using db.trace(println) as suggested in the documentation, but I want to use the XCGLogger library with something like log.info().

Somebody knows how to do it?


Solution

  • You can use a closure and call the log.info() function inside of it:

    db.trace { SQL in
        log.info(SQL)
    }