flutter_smart_logger 1.0.1 copy "flutter_smart_logger: ^1.0.1" to clipboard
flutter_smart_logger: ^1.0.1 copied to clipboard

A lightweight Flutter package for smart, formatted, and full debug logging of API responses and app data — works only in debug mode.

example/lib/main.dart

import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter_smart_logger/flutter_smart_logger.dart';

import 'package:http/http.dart' as http;

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    fetchBooking();
    return const MaterialApp(
      home: Scaffold(body: Center(child: Text("Check your console for logs"))),
    );
  }

  void fetchBooking() async {
    try {
      final response = await http.get(
        Uri.parse('https://jsonplaceholder.typicode.com/users/1'),
      );
      final data = jsonDecode(response.body);

      // Log response using our smart logger
      FlutterSmartLogger.log(data, tag: "API");
    } catch (e) {
      FlutterSmartLogger.log({
        "statusCode": 500,
        "error": e.toString(),
      }, tag: "API");
    }
  }
}
1
likes
145
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight Flutter package for smart, formatted, and full debug logging of API responses and app data — works only in debug mode.

Topics

#flutter #logging #debug #pretty-print #debug-logs

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_smart_logger