SourceHorizon / logger

Small, easy to use and extensible logger which prints beautiful logs.
https://pub.dev/packages/logger
MIT License
197 stars 33 forks source link

Logging not shown at all. #10

Closed your-diary closed 1 year ago

your-diary commented 1 year ago

How to Reproduce

  1. Create a Dart project.

    $ dart create abc
    $ cd abc
    $ dart pub add logger
  2. Edit bin/abc.dart.

    
    import 'package:logger/logger.dart';

void main() { final logger = Logger(level: Level.debug); logger.i("hello"); }


3. Run.

$ dart run #Nothing is printed.



# Workaround

When I execute `dart run --enable-asserts` instead of `dart run`, the log is printed.

Reading the official documentation, I couldn't find any section in which the need of `--enable-asserts` option is referred to. In addition, how can I enable logging when compiling a program with `dart compile exe`, given `--enable-asserts` cannot be specified in that context?
your-diary commented 1 year ago

I found an related issue in the original repository: https://github.com/simc/logger/issues/48

Given the fact that logger can be used in pure Dart (i.e. without Flutter), isn't the term "debug" and "release" confusing? It may be helpful to explicitly refer to the need of --enable-asserts not only in the documentation of DevelopmentFilter but also in README.md.

Anyway, closing...