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