Add methods to disable logger completely (#708)#861
Conversation
| @@ -433,9 +433,19 @@ class FlutterReactiveBle { | |||
| /// | |||
| /// Use [LogLevel.verbose] for full debug output. Make sure to run this only for debugging purposes. | |||
| /// Use [LogLevel.none] to disable logging. This is also the default. | |||
There was a problem hiding this comment.
if you set logLevel to LogLevel.none you will disable logs
There was a problem hiding this comment.
Even when setting the logLevel to none, the ressource hungry string interpolation happens. Please reopen!
| /// Sets the logger. | ||
| /// | ||
| /// Set to null to disable logging. | ||
| set logger(Logger? logger) { |
There was a problem hiding this comment.
can you please updated example app?
|
Thanks a lot for contributing, and sorry for closing it. I double-checked, and indeed it uses quite a lot of CPU time. Please update the example app and let's merge this one. It will be available in the next version. |
|
Ok, I will have a look at the example app. How should the behavior be in the example app? The example app still works as it is with the old behavior ( |
|
@Taym95 Otherwise all users have to disable it to get the best performance. This woul mean some more changes in the code and the example. What is your preferred solution? |
It makes sense, but some people are already using this. Functionality will stop working for them when the update happens |
As described in #708 the string interpolation can use quite a lot of CPU time, even if the logger is set to
LogLevel.none.This PR allows to set the
loggerto null which then removes the string interpolations.