logging_on_oslog

Creator: coderz1093

Last updated:

Add to Cart

Description:

logging on oslog

Log using os_log on iOS or macOS so that you can check the logs
using Console.app on a macOS machine.
iOS/macOS only #
This plugins works only on iOS and macOS. It is suggested
to verify the platform you are on before using this plugin:
import 'dart:io';

// ...

if (Platform.isIOS || Platform.isMacOS) {
// Use this plugin.
}
copied to clipboard
Warning about your user's privacy #
All logs are public. Anyone with access to the device will be
able to access the logs using Console.app.
If this plugin is used in production, it is important
that you filter the messages for private information before
logging them.
Getting Started #
If on macOS, make sure you target version 10.13 or greater.
Import the needed dependencies:
import 'package:logging_on_oslog/logging_on_oslog.dart';
import 'package:logging/logging.dart';
copied to clipboard
Subscribe to any Logger, for instance the root one. Make
sure that you are on iOS or macOS:
if (Platform.isIOS || Platform.isMacOS) {
_logOnOSLogSubscription = Logger.root.activateOsLog();
}
copied to clipboard
Log a message and see it in the Console.app:
Logger.root.info('info! Value: $_counter');
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.