ð Dev Log: The Ultimate Debug Companion for Flutter
A powerful, customizable debug logging package for Flutter with optional colors and emojis, automatic debug/release mode detection. Clean by default, beautiful when you want it.
ðĪ Why Use Dev Log?
Traditional Flutter logging solutions have limitations:
print(): No log levels, appears in production, truncates long messagesdeveloper.log(): Verbose syntax, manual debug checks required- Other packages: Complex setup, heavy dependencies, or forced styling
âĻ The Dev Log Advantage
dev_log provides a superior debugging experience with:
- ðïļ Optional Visual Enhancement: Clean by default, beautiful when enabled
- ð Automatic Production Safety: Silent in release builds, no manual checks needed
- ⥠Simple & Powerful API: From basic
Log.d()to advanced customization - ðŠķ Zero Dependencies: Lightweight with no external dependencies
ð Enhanced Features
- â 6 Log Levels: Verbose, Debug, Info, Warning, Error, and WTF (critical failures)
- â ðïļ Optional Emojis: Disabled by default, enable when you want visual flair
- â ðĻ Optional Colors: Independent color control for enhanced readability
- â ð Auto Debug Detection: Completely silent in release builds
- â âïļ Full Customization: Toggle colors, emojis, timestamps, and log levels independently
- â ðą Long Message Support: Auto-splits for Android logcat compatibility
- â ð Enhanced JSON Pretty Print: Beautiful JSON formatting
- â ð·ïļ Custom Tags: Organize logs for easy filtering and searching
- â
ð Extension Methods: Log any object with fluent
.logD(),.logI()syntax - â ð Stack Trace Support: Clean, readable error traces
- â ð Cross-Platform: Works on all Flutter platforms
- â ðŠķ Zero Dependencies: No external packages required
ðĶ Installation
Add to your pubspec.yaml:
dependencies:
dev_log: ^1.0.0 \# Use latest version
Install:
flutter pub get
ð Quick Start
import 'package:dev_log/dev_log.dart';
// Clean, professional logging (default - no emojis)
Log.v('Verbose: Detailed debugging info');
Log.d('Debug: General debugging');
Log.i('Info: Application information');
Log.w('Warning: Needs attention');
Log.e('Error: Something went wrong');
Log.wtf('Critical: System failure!');
// Short aliases for all levels
L.v('Verbose'); L.d('Debug'); L.i('Info');
L.w('Warning'); L.e('Error'); L.wtf('Critical!');
// Want emojis? Enable them!
Log.setEmojis(true);
Log.d('Debug with emoji'); // ð [DEBUG] [19:45:15.123] Debug with emoji
// Extension methods work with all levels
'System ready'.logI(); // Info
'Memory low'.logW(); // Warning
'Network failed'.logE(); // Error
'System crash!'.logWtf(); // Critical
ðïļ Customization - Your Choice!
Emojis are optional - choose what works best for your team:
Default Behavior (Clean & Professional)
// Clean output by default
Log.d('Debug message');
// Output: [DEBUG] [19:45:15.123] Debug message
Enable Visual Enhancements
// Enable emojis for visual appeal
Log.setEmojis(true);
Log.d('Debug message');
// Output: ð [DEBUG] [19:45:15.123] Debug message
// Independent controls
Log.setEmojis(false); // Disable emojis
Log.setColors(false); // Disable colors
Log.setTimestamp(false); // Hide timestamps
Log.setLogLevel(false); // Hide log levels
// Configure all at once
Log.configure(
emojis: true, // Optional visual flair
colors: true, // Optional colors
timestamp: true, // Show timestamps
logLevel: true, // Show log levels
);
Configuration Examples
// Professional (default)
Log.d('Clean message');
// Output: [DEBUG] [19:45:15.123] Clean message
// With emojis
Log.setEmojis(true);
Log.d('Enhanced message');
// Output: ð [DEBUG] [19:45:15.123] Enhanced message
// Minimal
Log.configure(emojis: false, colors: false, timestamp: false, logLevel: false);
Log.d('Minimal message');
// Output: Minimal message
ð Comprehensive Usage Examples
All Log Levels
// Professional output (emojis disabled by default)
Log.v('Verbose: Starting application initialization');
Log.d('Debug: Loading user preferences');
Log.i('Info: User authentication successful');
Log.w('Warning: API response time is slow');
Log.e('Error: Failed to save user data');
Log.wtf('Critical: Database connection lost!');
// Enable emojis for visual enhancement
Log.setEmojis(true);
Log.v('Verbose with emoji'); // ð [VERBOSE] ...
Log.d('Debug with emoji'); // ð [DEBUG] ...
Log.i('Info with emoji'); // âđïļ [INFO] ...
Log.w('Warning with emoji'); // â ïļ [WARN] ...
Log.e('Error with emoji'); // â [ERROR] ...
Log.wtf('Critical with emoji'); // ðĨ [WTF] ...
Advanced Features
// Enhanced JSON logging
Map<String, dynamic> userData = {
'name': 'John Doe',
'age': 30,
'preferences': {'theme': 'dark', 'notifications': true},
'permissions': ['read', 'write', 'admin']
};
Log.json(userData, 'USER_DATA');
// Long message auto-splitting
Log.long('This very long message will be automatically split...');
// Custom tags for organization
Log.d('Connection established', 'DATABASE');
Log.i('User session started', 'AUTH');
Log.w('Rate limit: 90% of quota used', 'API');
Log.e('Payment processing failed', 'PAYMENT');
Log.wtf('Security breach detected!', 'SECURITY');
// Method tracing
Log.trace('Method execution started');
Log.trace('Performance checkpoint', 'TIMING');
Extension Methods Magic
// String interpolation with extensions
String userName = 'Alice';
// Clean professional logging (default)
'Debug: Processing login for \$userName'.logD();
'Info: User \$userName authenticated successfully'.logI('AUTH');
'Warning: User \$userName has 2 attempts left'.logW('SECURITY');
'Error: Authentication failed for \$userName'.logE('AUTH');
'Critical: Account \$userName compromised!'.logWtf('SECURITY');
// Object extensions
Map<String, dynamic> config = {
'apiUrl': 'https://api.example.com',
'timeout': 5000
};
config.logJson('CONFIG'); // Pretty JSON logging
List<String> tags = ['flutter', 'mobile'];
tags.logD('TAGS'); // List logging
String apiResponse = 'Very long API response...';
apiResponse.logLong('API_RESPONSE'); // Auto-split logging
ðŊ Log Level Guide
| Level | Method | Default | With Emojis | Usage |
|---|---|---|---|---|
| Verbose | Log.v() / L.v() |
[VERBOSE] |
ð [VERBOSE] |
Detailed debugging info |
| Debug | Log.d() / L.d() |
[DEBUG] |
ð [DEBUG] |
General debugging |
| Info | Log.i() / L.i() |
[INFO] |
âđïļ [INFO] |
Application flow |
| Warning | Log.w() / L.w() |
[WARN] |
â ïļ [WARN] |
Potential issues |
| Error | Log.e() / L.e() |
[ERROR] |
â [ERROR] |
Errors, exceptions |
| WTF | Log.wtf() / L.wtf() |
[WTF] |
ðĨ [WTF] |
Critical failures |
ðïļ Customization Options
| Configuration | Emojis | Colors | Output Example |
|---|---|---|---|
| Default | â | â | [DEBUG] [19:45:15.123] Message |
| Emojis Only | â | â | ð [DEBUG] [19:45:15.123] Message |
| Colors Only | â | â | [DEBUG] [19:45:15.123] Message (colored) |
| Full Visual | â | â | ð [DEBUG] [19:45:15.123] Message (colored) |
| Minimal | â | â | Message |
// Individual controls
Log.setEmojis(true); // Toggle emojis
Log.setColors(false); // Toggle colors
Log.setTimestamp(false); // Toggle timestamps
Log.setLogLevel(false); // Toggle log levels
// Batch configuration
Log.configure(
emojis: false, // Professional look
colors: true, // Enhanced readability
timestamp: true, // Timing information
logLevel: true, // Level identification
);
ð Production Safety
The package automatically detects Flutter's debug mode using kDebugMode:
In Debug Builds:
- â Full logging with optional visual enhancements
- â All features active and customizable
- â Beautiful console output when desired
In Release Builds:
- â Zero output - completely silent
- â Zero overhead - minimal performance impact
- â No sensitive data leaks - automatic protection
ð Platform Support
Works perfectly across all Flutter platforms:
- ðą Android - Full color and optional emoji support
- ðą iOS - Complete feature compatibility
- ð Web - Browser console integration
- ðŧ Windows - Terminal color support
- ðŧ macOS - Native console integration
- ð§ Linux - Full terminal compatibility
ð Performance
- Debug Mode: Rich features with minimal impact
- Release Mode: Zero overhead, completely compiled out
- Memory: Lightweight with no persistent storage
- CPU: Optimized string formatting and output
ðĻ Design Philosophy
Clean by default, beautiful when you want it:
- Default Experience: Professional, clean logs without visual clutter
- Optional Enhancement: Enable emojis and colors when your team wants them
- Independent Controls: Mix and match visual elements as needed
- Zero Configuration: Works great out of the box
- Full Customization: Adapt to any team preference or environment
ðĪ Contributing
We welcome contributions! Please check our GitHub repository for:
- ð Bug reports
- ðĄ Feature requests
- ð§ Pull requests
- ð Documentation improvements
ð License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with âĪïļ for the Flutter community - Clean by default, beautiful when you want it!