[go: up one dir, main page]

l 1.1.1 copy "l: ^1.1.1" to clipboard
l: ^1.1.1 copied to clipboard

outdated

Crossplatform html/io [L]ogger library with simple API. Manipulate with native console and store logs in txt files and indexedDB. Support ascii colorize output.

example/main.dart

// ignore_for_file: unnecessary_statements, avoid_print
import 'dart:async' show Future;

import 'package:l/l.dart';

void main() => _displayStatuses()
    .whenComplete(_showProgressBar)
    .whenComplete(_displayDetails);

Future<void> _displayStatuses() async {
  l.store = true;
  l.s('shout me');
  l.e('error msg');
  l.w('warning msg');
  l.i('info msg');
  l < 'alt info msg';
  l.d('debug msg');
  l << 'alt debug msg';
}

Future<void> _showProgressBar() =>
    Stream<int>.fromIterable(List<int>.generate(101, (int v) => v))
        .asyncMap<int>((int v) =>
            Future<int>.delayed(const Duration(milliseconds: 50), () => v))
        .forEach((int v) => l.p(
            percent: v,
            header: '{{ HEADER #$v }}',
            footer: '{{ footer #$v }}',
            data: '{{ data $v% }}'))
          ..whenComplete(l.resume);

Future<void> _displayDetails() async {
  l.v('verbose lvl #1');
  l.vv('verbose lvl #2');
  l.vvv('verbose lvl #3');
  l.vvvv('verbose lvl #4');
  l.vvvvv('verbose lvl #5');
  l.vvvvvv('verbose lvl #6');
}
90
likes
30
points
2.81k
downloads

Publisher

verified publisherplugfox.dev

Weekly Downloads

Crossplatform html/io [L]ogger library with simple API. Manipulate with native console and store logs in txt files and indexedDB. Support ascii colorize output.

License

MIT (license)

Dependencies

meta

More

Packages that depend on l