flutter_blue icon indicating copy to clipboard operation
flutter_blue copied to clipboard

Standardize logging across entire plugin

Open pauldemarco opened this issue 6 years ago • 7 comments

Platform code contains logging that should be user-configurable.

Allow the user to change verbosity level for the plugin.

pauldemarco avatar Mar 09 '18 20:03 pauldemarco

Model after journald:

... takes one of "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug", or integer values in the range of 0–7 (corresponding to the same levels). Messages equal or below the log level specified are stored/forwarded, messages above are dropped.

enum LogLevel {
    emergency,
    alert,
    critical,
    error,
    warning,
    notice,
    info,
    debug,
}

Allow LogLevel to be set at any time:

FlutterBlue.instance.setLogLevel(LogLevel level);

LogLevel must also be passed to platform side to be used by underlying Android/iOS.

pauldemarco avatar Dec 14 '18 21:12 pauldemarco

Setting log level with setLogLevel:

  • [x] Dart
  • [x] iOS
  • [x] Android

Finalize log messages on each platform:

  • [ ] Dart
  • [ ] iOS
  • [ ] Android

pauldemarco avatar Dec 29 '18 07:12 pauldemarco

Emulate the format of error messages in latest Flutter (1.9)

pauldemarco avatar Sep 12 '19 07:09 pauldemarco

Log messages need to be changed from NSLog to log on iOS.

pauldemarco avatar Dec 10 '19 10:12 pauldemarco

@pauldemarco Unfortunately this no longer seems to be woorking in 0.7.3 , after setting FlutterBlue.instance.setLogLevel(LogLevel.critical); still has all the notification debug messages being logged.

maks avatar Feb 08 '21 03:02 maks

Is this still an issue? Log level used to work for me, but I'm now running into the issues @maks mentioned. Any solutions or additions needed to fix this, or has it not been addressed yet?

tylermcdonald avatar Apr 19 '21 20:04 tylermcdonald

any news on this? this package is awesome but the amount of logs make it hard to debug

lookacat avatar Sep 28 '22 18:09 lookacat