ispectify 4.1.5
ispectify: ^4.1.5 copied to clipboard
An additional package for ISpect (logging and handling). Based on Talker.
π Overview #
ISpectify is the foundation logging system that powers the ISpect debugging toolkit.
π Logging β’ π Filtering β’ π Monitoring β’ πΎ Export
ISpectify provides a robust logging foundation that integrates seamlessly with the ISpect ecosystem. Built on top of the proven Talker logging library, it offers advanced features for debugging and monitoring Flutter applications.
π― Key Features #
- π Structured Logging: Advanced logging with categorization and filtering
- π¨ Custom Log Types: Define your own log types with custom colors and icons
- π Real-time Filtering: Filter logs by type, level, and custom criteria
- π Performance Monitoring: Track application performance metrics
- πΎ Export Functionality: Export logs for analysis and debugging
- π§ Easy Integration: Simple setup with minimal configuration
π§ Configuration #
Settings #
final logger = ISpectify(
logger: ISpectifyLogger(
settings: LoggerSettings(
enableColors: false,
)),
options: ISpectifyOptions(
enabled: true,
useHistory: true,
useConsoleLogs: true,
maxHistoryItems: 10000,
logTruncateLength: 10000,
titles: {
'error': 'Error Logs',
'info': 'Info Logs',
'debug': 'Debug Logs',
},
colors: {
'error': AnsiPen()..red(),
'info': AnsiPen()..blue(),
'debug': AnsiPen()..white(),
},
),
);
Custom Log Types #
class CustomLog extends ISpectifyData {
CustomLog(
String super.message,
) : super(
key: 'custom_log',
title: 'Custom Log',
);
}
logger.logCustom(CustomLog('This is a custom log message'));
π¦ Installation #
Add ispectify to your pubspec.yaml:
dependencies:
ispectify: ^4.1.4
π Quick Start #
import 'package:flutter/material.dart';
import 'package:ispect/ispect.dart';
class CustomLog extends ISpectifyData {
CustomLog(
String super.message,
) : super(
key: 'custom_log',
title: 'Custom Log',
);
}
void main() {
// Initialize ISpectify for logging
final ISpectify logger = ISpectify(
logger: ISpectifyLogger(
settings: LoggerSettings(
enableColors: false,
)),
options: ISpectifyOptions(
enabled: true,
useHistory: true,
useConsoleLogs: true,
maxHistoryItems: 10000,
logTruncateLength: 10000,
titles: {
'error': 'Error Logs',
'info': 'Info Logs',
'debug': 'Debug Logs',
},
colors: {
'error': AnsiPen()..red(),
'info': AnsiPen()..blue(),
'debug': AnsiPen()..white(),
},
),
);
logger.info('ISpectify initialized successfully');
// Wrap your app with ISpect
ISpect.run(
() => runApp(MyApp()),
logger: logger,
);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('ISpectify Example')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
ISpect.logger.info('Info log message');
},
child: const Text('Log Info'),
),
ElevatedButton(
onPressed: () {
ISpect.logger.logCustom(CustomLog('Custom log message'));
},
child: const Text('Log Custom'),
),
],
),
),
),
);
}
}
π Examples #
See the example/ directory for usage examples and integration patterns.
ποΈ Architecture #
ISpectify serves as the logging foundation for the ISpect ecosystem:
| Component | Description |
|---|---|
| Core Logger | Based on Talker with enhanced features |
| Log Filtering | Advanced filtering and search capabilities |
| Performance Tracking | Built-in performance monitoring |
| Export System | Log export and analysis tools |
| Integration Layer | Seamless integration with ISpect toolkit |
π€ Contributing #
Contributions are welcome! Please read our contributing guidelines and submit pull requests to the main branch.
π License #
This project is licensed under the MIT License - see the LICENSE file for details.
π Related Packages #
- ispect - Main debugging interface
- ispectify_dio - Dio HTTP client integration
- ispectify_http - Standard HTTP client integration
- ispectify_bloc - BLoC state management integration