From 30c0b1ee49d92b0336bf032ed4f61bbeaaabacb2 Mon Sep 17 00:00:00 2001 From: Jemis Goti <46031164+jemisgoti@users.noreply.github.com> Date: Wed, 4 Jan 2023 23:46:00 +0530 Subject: [PATCH] Connection setting now support log level Default log level is [Level.INFO]. We can set log level as per convenience of the app --- lib/src/single_connection.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/single_connection.dart b/lib/src/single_connection.dart index 8a4a0a1..7e52f00 100644 --- a/lib/src/single_connection.dart +++ b/lib/src/single_connection.dart @@ -38,6 +38,8 @@ class ConnectionSettings { bool useSSL; int maxPacketSize; int characterSet; + ///Default log level is [Level.INFO]. We can set log level as per convenience of the app + Level level; /// The timeout for connecting to the database and for all database operations. Duration timeout; @@ -52,7 +54,12 @@ class ConnectionSettings { this.useSSL = false, this.maxPacketSize = 16 * 1024 * 1024, this.timeout = const Duration(seconds: 30), - this.characterSet = CharacterSet.UTF8MB4}); + + + this.level = Level.INFO, + this.characterSet = CharacterSet.UTF8MB4}) { + Logger.root.level = level; // defaults to Level.INFO + } factory ConnectionSettings.socket( {required String path, @@ -85,6 +92,7 @@ class ConnectionSettings { useSSL = o.useSSL, maxPacketSize = o.maxPacketSize, timeout = o.timeout, + level = o.level, characterSet = o.characterSet; }