Use app logger for orm

This commit is contained in:
Tobe O 2019-05-01 19:32:31 -04:00
parent ece9e5d4fa
commit 514b697b00

View file

@ -9,8 +9,11 @@ Future<void> configureServer(Angel app) async {
var connection = await connectToPostgres(app.configuration);
await connection.open();
var logger = app.environment.isProduction ? null : app.logger;
var executor = PostgreSqlExecutor(connection, logger: logger);
app
..container.registerSingleton<QueryExecutor>(PostgreSqlExecutor(connection))
..container.registerSingleton<QueryExecutor>(executor)
..shutdownHooks.add((_) => connection.close());
}