mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Single line logging in tests and default Configuration.logSQL
This commit is contained in:
1 parent
695adcacf7
commit
e0551e17fc
2 files changed
+6
-4
No files matched your search
@@ -14,9 +14,10 @@ class GRDBTestCase: XCTestCase {
|
||||
do { try NSFileManager.defaultManager().removeItemAtPath(databasePath) } catch { }
|
||||
let configuration = Configuration(trace: { (sql, arguments) in
|
||||
self.sqlQueries.append(sql)
|
||||
NSLog("GRDB: %@", sql)
|
||||
if let arguments = arguments {
|
||||
NSLog("GRDB: arguments %@", arguments.description)
|
||||
NSLog("GRDB: %@ -- arguments: %@", sql, arguments.description)
|
||||
} else {
|
||||
NSLog("GRDB: %@", sql)
|
||||
}
|
||||
})
|
||||
dbQueue = try! DatabaseQueue(path: databasePath, configuration: configuration)
|
||||
|
||||
@@ -7,9 +7,10 @@ public struct Configuration {
|
||||
|
||||
/// A tracing function that logs SQL statements
|
||||
public static func logSQL(sql: String, arguments: StatementArguments?) {
|
||||
NSLog("GRDB: %@", sql)
|
||||
if let arguments = arguments {
|
||||
NSLog("GRDB: arguments %@", arguments.description)
|
||||
NSLog("GRDB: %@ -- arguments: %@", sql, arguments.description)
|
||||
} else {
|
||||
NSLog("GRDB: %@", sql)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user