simple_logger_overlay 0.1.4
simple_logger_overlay: ^0.1.4 copied to clipboard
A simple, Dart 3+ compatible Flutter logging plugin with an in-app draggable overlay, log levels, and Dio support
simple_logger_overlay
#
A lightweight, Dart 3-compatible Flutter logging package with a draggable in-app log viewer overlay โ inspired by let_log, rebuilt for modern apps.
Built with ๐ by Saumya Macwan.
โจ Features #
- ๐ง Non-blocking: Log I/O runs in a background isolate
- ๐ Material 3 overlay, dark/light theme aware
- ๐ Pretty-printed JSON views for network logs
- ๐ Dio interceptor for network logging with status coloring
- ๐ฌ Integrates with BLoC, Riverpod, GetX, and
logger - ๐ Filter, sort, search logs
- ๐ค Export logs as
.json, or copy to clipboard - ๐งพ Detailed log view on card tap
- ๐ Shake-to-open overlay (debug-only)
- ๐ Draggable floating debug button
- ๐ Optional:
GoRouterObserver,AppLifecycleObserver - ๐ฅ๏ธ Emoji + color-coded console logging (with toggle)
- ๐งฐ Simple static API:
SimpleLoggerOverlay.log(...)
๐ฑ Screenshots #
๐ Getting Started #
import 'package:simple_logger_overlay/simple_logger_overlay.dart';
@override
Widget build(BuildContext context) {
return FloatingActionButton(
onPressed: () {
SimpleLoggerOverlay.show(context);
},
child: const Icon(Icons.file_present),
);
}
๐ชต Log from Anywhere #
Log directly with the static API:
SimpleLoggerOverlay.log("Something happened", level: LogLevel.info, tag: 'HomeScreen');
๐งฉ Integrations #
๐ง BLoC
import 'package:simple_logger_overlay/core/bloc_logger_observer.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
Bloc.observer = SimpleOverlayBlocObserverLogger();
}
๐ฑ Riverpod
import 'package:simple_logger_overlay/core/riverpod_logger.dart';
void main() {
runApp(
ProviderScope(
observers: [SimpleOverlayLoggerRiverpodObserver()],
child: const MyApp(),
),
);
}
โก GetX
import 'package:simple_logger_overlay/core/getx_logger_patch.dart';
void main() {
simpleOverlayGetXLogObserver();
}
๐ Dio Interceptor
import 'package:dio/dio.dart';
import 'package:simple_logger_overlay/core/network_logger_interceptor.dart';
final dio = Dio()
..interceptors.add(NetworkLoggerInterceptor());
๐งญ GoRouter
MaterialApp.router(
routerDelegate: GoRouter(
observers: [SimpleOverlayGoRouterObserver()],
...
).routerDelegate,
);
๐ฑ App Lifecycle
WidgetsBinding.instance.addObserver(SimpleOverlayAppLifecycleObserver());
๐ Debug Floating Button #
Stack(
children: [
child!,
const DraggableDebuggerFAB(navigatorKey: rootNavigatorKey),
],
);
๐ป Console Logging #
Logs are also printed in your terminal with emojis and color by default.
[2025-06-24T19:15:01.000Z] ๐ [DEBUG] [LoginBloc] Event dispatched
[2025-06-24T19:15:02.000Z] ๐ฅ [ERROR] [LoginBloc] Invalid password
Disable if needed:
LogStorageService.enableConsole = false;
๐ฆ Export Logs #
Use the export button in the top-right corner of the overlay to:
- ๐ค Export logs as
.json - ๐ Copy current log to clipboard
๐ ๏ธ License #
MIT ยฉ 2025 Saumya Macwan