astute_logger 0.0.1 copy "astute_logger: ^0.0.1" to clipboard
astute_logger: ^0.0.1 copied to clipboard

A simple and powerful logger for Flutter apps with support for color-coding, JSON pretty-printing, and performance tracking.

example/lib/main.dart

import 'package:astute_logger/astute_logger.dart';

void main() {
  final log = Logger("ExampleService");

  // ๐Ÿ”ต Basic message
  log.write(message: "App started", level: LogLevel.info);

  // ๐ŸŸข Debug message
  log.write(message: "Fetching user...", level: LogLevel.debug);

  // ๐ŸŸก Warning
  log.write(message: "Low internet connection", level: LogLevel.warning);

  // ๐Ÿ”ด Error
  log.write(message: "Failed to load data", level: LogLevel.error);

  // ๐ŸŽจ Log with color
  log.logWithColor("Custom colored success log", color: LogColor.green.code);

  // ๐Ÿงพ Pretty JSON
  log.logJson({
    "id": 1,
    "name": "John",
    "role": "admin",
  });

  // ๐Ÿงพ Pretty JSON string
  log.write(
    message: '{"status": "ok", "items": [1,2,3]}',
    prettyPrint: true,
    level: LogLevel.info,
  );

  // ๐Ÿ“‹ Pretty List
  log.logPrettyList(["Apple", "Banana", "Orange"], label: "Fruits");

  // โฑ Execution time measurement
  log.logExecutionTime("Compute sum", () {
    final list = List.generate(5000, (i) => i);
    return list.reduce((a, b) => a + b);
  });
}
3
likes
160
points
43
downloads

Publisher

unverified uploader

Weekly Downloads

A simple and powerful logger for Flutter apps with support for color-coding, JSON pretty-printing, and performance tracking.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on astute_logger