logger_flutter 0.7.1 copy "logger_flutter: ^0.7.1" to clipboard
logger_flutter: ^0.7.1 copied to clipboard

Flutter extension for logger. Please go there for documentation.

example/lib/main.dart

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

import 'package:logger/logger.dart';
import 'package:logger_flutter/logger_flutter.dart';

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

var logger = Logger(
  printer: PrettyPrinter(),
);

var loggerNoStack = Logger(
  printer: PrettyPrinter(methodCount: 0),
);

void log() {
  logger.d("Log message with 2 methods");

  loggerNoStack.i("Info message");

  loggerNoStack.w("Just a warning!");

  logger.e("Error! Something bad happened", "Test Error");

  loggerNoStack.v({"key": 5, "value": "something"});

  Future.delayed(Duration(seconds: 5), log);
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: LogConsoleOnShake(
          dark: true,
          child: Center(
            child: Text("Shake Phone to open Console."),
          ),
        ),
      ),
    );
  }
}
63
likes
40
pub points
65%
popularity

Publisher

unverified uploader

Flutter extension for logger. Please go there for documentation.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, logger, sensors

More

Packages that depend on logger_flutter