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

Cross-platform html/io Logger library with simple API. Manipulate with native and web console. Support ascii colorize output.

example/main.dart

// ignore_for_file: public_member_api_docs, avoid_print
library l.example;

import 'dart:async';

import 'package:l/l.dart';

void main() => l.capture<void>(
      () => runZonedGuarded<void>(
        () {
          l
            ..v('Regular 1')
            ..e('Error')
            ..w('Warning')
            ..i('Info')
            ..d('Debug')
            ..s('Shout')
            ..v6('Regular 6');
          print('Hello from original print!');
          l.v('Running');
          throw Exception('Exception');
        },
        l.e,
      ),
      const LogOptions(
        handlePrint: true,
        messageFormatting: _messageFormatting,
        outputInRelease: false,
        printColors: true,
      ),
    );

Object _messageFormatting(Object message, LogLevel logLevel, DateTime now) =>
    '${_timeFormat(now)} | $message';

String _timeFormat(DateTime time) =>
    '${time.hour}:${time.minute.toString().padLeft(2, '0')}';
86
likes
140
pub points
91%
popularity
screenshot

Publisher

verified publisherplugfox.dev

Cross-platform html/io Logger library with simple API. Manipulate with native and web console. Support ascii colorize output.

Homepage
Repository (GitHub)
View/report issues

Topics

#cross-platform #logging

Documentation

API reference

Funding

Consider supporting this project:

www.buymeacoffee.com
www.patreon.com
boosty.to

License

MIT (license)

Dependencies

meta

More

Packages that depend on l