easy_localization icon indicating copy to clipboard operation
easy_localization copied to clipboard

log level not customizable, LevelMessages is not part of the public api

Open cedvdb opened this issue 4 years ago • 6 comments

You need to make the class LevelMessages visible in the public api.

It would also be better if the logging dependency was removed altogether and instead an onEvent callback could be passed where the user could decide how to print those.

If every library does this you'll end up with all the logging implementation possible

cedvdb avatar Apr 13 '21 12:04 cedvdb

In pubspec.yaml just add dependency

dependencies:
  easy_logger:

And then you'll be able to configure log level

import 'package:easy_logger/easy_logger.dart';

...

EasyLocalization.logger.enableLevels = [
  LevelMessages.error,
];
await EasyLocalization.ensureInitialized();

sgissinger avatar May 23 '21 00:05 sgissinger

That is not a fix, it's installing the needed dependency which should be done by the library. And to be honest it would be better if the choice of logging lib was let on the user by providing an OnEvent callback which the user could decide how to print. If every library chose its own logging system soon enough you have 20 of thems.

cedvdb avatar May 23 '21 13:05 cedvdb

I totally agree with you. This is only a workaround until a better solution is released. I use it to have clean unit tests output.

sgissinger avatar May 23 '21 17:05 sgissinger

@Overman775 would a PR that removes the easy logger dependency be welcome ?

cedvdb avatar Jun 09 '21 12:06 cedvdb

Would be good to see some progress here.

petrnymsa avatar Jul 28 '21 17:07 petrnymsa