feat: Set loglevel in client constructor

This is just more convenient than
doing it in a line after the constructor.
This commit is contained in:
Christian Pauly 2022-03-25 12:12:43 +01:00
parent c897127be5
commit abddbee24c
1 changed files with 2 additions and 0 deletions

View File

@ -157,6 +157,7 @@ class Client extends MatrixApi {
this.mxidLocalPartFallback = true,
this.formatLocalpart = true,
this.compute,
Level? logLevel,
Filter? syncFilter,
@deprecated bool? debug,
}) : syncFilter = syncFilter ??
@ -174,6 +175,7 @@ class Client extends MatrixApi {
super(
httpClient:
VariableTimeoutHttpClient(httpClient ?? http.Client())) {
if (logLevel != null) Logs().level = logLevel;
importantStateEvents.addAll([
EventTypes.RoomName,
EventTypes.RoomAvatar,