ispectify 0.0.2 copy "ispectify: ^0.0.2" to clipboard
ispectify: ^0.0.2 copied to clipboard

An additional package for ISpect (logging and handling). Based on Talker.

example/ispectify_example.dart

import 'package:ispectify/ispectify.dart';

Future<void> main() async {
  final iSpectify = ISpectify(
    options: ISpectifyOptions(
      colors: {
        ISpectifyLogType.info.key: AnsiPen()..magenta(),
        CustomLog.logKey: AnsiPen()..green(),
      },
      titles: {
        ISpectifyLogType.info.key: 'i',
        CustomLog.logKey: 'Custom',
      },
    ),
  )
    ..error('The restaurant is closed ❌')
    ..info('Ordering from other restaurant...');

  try {
    throw Exception('Something went wrong');
  } catch (e, st) {
    iSpectify.handle(e, st, 'Exception with');
  }

  iSpectify.logCustom(CustomLog('Something like your own service message'));
}

class CustomLog extends ISpectifyLog {
  CustomLog(super.message);

  static const logKey = 'custom_log_key';

  @override
  String? get key => logKey;
}
2
likes
0
points
683
downloads

Publisher

verified publishershodev.live

Weekly Downloads

An additional package for ISpect (logging and handling). Based on Talker.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ansicolor

More

Packages that depend on ispectify