ente/thirdparty/super_logging
2021-11-01 15:45:23 +05:30
..
lib null-safety: migrate super_logging using dart migrate 2021-11-01 15:45:23 +05:30
test Clone super_logging and make it privacy friendly 2021-01-13 23:08:58 +05:30
.gitignore Clone super_logging and make it privacy friendly 2021-01-13 23:08:58 +05:30
.metadata Clone super_logging and make it privacy friendly 2021-01-13 23:08:58 +05:30
LICENSE Clone super_logging and make it privacy friendly 2021-01-13 23:08:58 +05:30
pubspec.yaml null-safety: migrate super_logging using dart migrate 2021-11-01 15:45:23 +05:30
README.md Clone super_logging and make it privacy friendly 2021-01-13 23:08:58 +05:30

Super Logging

Sponsor

pub package

This package lets you easily log to:

  • stdout
  • disk
  • sentry.io
import 'package:super_logging/super_logging.dart';
import 'package:logging/logging.dart';

final logger = Logger("main");

main() async {
  // just call once, and let it handle the rest!
  await SuperLogging.main();
  
  logger.info("hello!");
}

(Above example will log to stdout and disk.)

Logging to sentry.io

Just specify your sentry DSN.

SuperLogging.main(LogConfig(
  sentryDsn: 'https://xxxx@sentry.io/yyyy',
));

Log uncaught errors

Just provide the contents of your main() function to super logging.

void main() {
  SuperLogging.main(LogConfig(
    body: _main,
  ));
}

void _main() {
  runApp(MyApp());
}

Read the docs to know about more customization options.