diff --git a/Sources/App/Management/Configuration.swift b/Sources/App/Management/Configuration.swift index 1c9f451..f4915a1 100644 --- a/Sources/App/Management/Configuration.swift +++ b/Sources/App/Management/Configuration.swift @@ -6,6 +6,13 @@ struct Configuration { let mail: EMail + /** + Use a database file and reduce logging. + + If this property is set to `false`, then an in-memory database is used with increased logging. + */ + let production: Bool + struct EMail { /// The url to the root of the server diff --git a/Sources/App/configure.swift b/Sources/App/configure.swift index 1f6a2e6..f7b63e8 100644 --- a/Sources/App/configure.swift +++ b/Sources/App/configure.swift @@ -16,11 +16,10 @@ public func configure(_ app: Application) throws { // Set target environment app.environment = .production - if app.environment == .development { + if !configuration.production { app.logger.logLevel = .info print("[DEVELOPMENT] Using in-memory database") app.databases.use(.sqlite(.memory), as: .sqlite) - } else { app.logger.logLevel = .notice let dbFile = storageFolder.appendingPathComponent("db.sqlite").path