diff --git a/README.md b/README.md index 1f16ecaee..f408ce716 100644 --- a/README.md +++ b/README.md @@ -5466,7 +5466,7 @@ See [prepared statements](#prepared-statements) and [DatabaseValue](#databaseval **SQLite can be configured to invoke a callback function containing an error code and a terse error message whenever anomalies occur.** -It is recommended that you setup, early in the lifetime of your application, the error logging callback: +This global error callback must be configured early in the lifetime of your application: ```swift Database.logError = { (resultCode, message) in @@ -5474,6 +5474,8 @@ Database.logError = { (resultCode, message) in } ``` +> :warning: **Warning**: Database.logError must be set before any database connection is opened. This includes the connections that your application opens with GRDB, but also connections opened by other tools, such as third-party libraries. Setting it after a connection has been opened is an SQLite misuse, and has no effect. + See [The Error And Warning Log](https://sqlite.org/errlog.html) for more information.