logging_on_oslog 1.1.0 copy "logging_on_oslog: ^1.1.0" to clipboard
logging_on_oslog: ^1.1.0 copied to clipboard

PlatformiOSmacOS

Log using os_log on iOS or macOS so that you can check the logs using Console.app on a macOS machine.

pub package package publisher style: very good analysis melos

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.
}

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';

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();
}

Log a message and see it in the Console.app:

Logger.root.info('info! Value: $_counter');

Example of logging_on_oslog with Console.app and iOS simulator

3
likes
160
pub points
79%
popularity
screenshot

Publisher

verified publishervolpato.dev

Log using os_log on iOS or macOS so that you can check the logs using Console.app on a macOS machine.

Repository
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, logging, plugin_platform_interface

More

Packages that depend on logging_on_oslog