d-markey / squadron

Multithreading and worker thread pool for Dart / Flutter, to offload CPU-bound and heavy I/O tasks to Isolate or Web Worker threads.
https://pub.dev/packages/squadron
MIT License
79 stars 0 forks source link

Shorten log message with settings #16

Closed VladimirCores closed 1 year ago

VladimirCores commented 1 year ago

Could you please add a property that will disable time and frame information in the logs? Thanks.

image

d-markey commented 1 year ago

Hello,

I've taken a different approach to avoid adding new parameters to Squadron and decided to split the code between message formatting and message emitting in the base logger (default formatting simply calls message.ToString()). You can then implement your own logger on top of BaseSquadronLogger and avoid having the header in the log messages. E.g.:

class MySquadronLogger extends BaseSquadronLogger {
  /// Log to console
  @override
  void log(String message) => print(message);
}

Please upgrade to Squadron 4.3.4.

d-markey commented 1 year ago

Closing this, please let me know if you need further help.

VladimirCores commented 1 year ago

Smart suggestion, thank you @d-markey ; )