jogboms / logging_to_logcat

Add a function to Logger to make it print to Logcat

Home Page:https://pub.dev/packages/logging_to_logcat

Repository from Github https://github.comjogboms/logging_to_logcatRepository from Github https://github.comjogboms/logging_to_logcat

logging_to_logcat

This package extends the logging-package with the functionality to deliver it's logs to Android's Logcat.

Usage

After adding the package it's easy to instruct Logger to send it's logging data to Android's Logcat:

import 'package:logging_to_logcat/logging_to_logcat.dart';
import 'package:logging/logging.dart';

Logger.root.activateLogcat();

final Logger log = Logger("MyLogger");
log.info('demo logline!');

Documentation

Logger has a more fine-grained way of defining logging levels then Android. This plugin does the following mappings:

FINEST -> VERBOSE
FINER -> VERBOSE
FINE -> VERBOSE
CONFIG -> DEBUG
INFO -> INFO
WARNING -> WARNING
SEVERE -> ERROR
SHOUT -> ERROR

Note that by default Logger silences messages under the level of INFO. If it's desired that all Logging makes it to Logcat it's necessary to call:

Logger.root.level = Level.ALL;

Contributions

Especially, given that this is the first package I published on pub.dev I'm happy about any pointers of how it can be improved.

About

Add a function to Logger to make it print to Logcat

https://pub.dev/packages/logging_to_logcat

License:Other


Languages

Language:Dart 56.1%Language:Kotlin 20.1%Language:Swift 8.6%Language:Ruby 8.3%Language:Objective-C 6.9%