ispectify 4.2.0 copy "ispectify: ^4.2.0" to clipboard
ispectify: ^4.2.0 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...')
    ..provider('Provider is ready')
    ..good('The food is ready ✅')
    ..track(
      'User clicked on the button',
      analytics: 'Amplitude',
      parameters: {'button': 'order'},
    );

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

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

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

  static const logKey = 'custom_log_key';

  @override
  String? get key => logKey;
}
2
likes
160
points
1.46k
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

ansicolor, collection, web

More

Packages that depend on ispectify