ispectify 0.0.1-dev.2 ispectify: ^0.0.1-dev.2 copied to clipboard
Advanced error handler and logger package for flutter and dart. App monitoring, logs history, report sharing, custom logs, and etc.
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;
}